Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Deletes a file
<?php unlink(string $filename, ?resource $context = null): bool
<?php         $this->assertEquals($img->extension, 'jpg');

        $this->assertEquals($img->filename, 'foo');

        $this->assertEquals($img->mime, 'image/jpeg');

        @unlink($save_as);



        $save_as = 'tests/tmp/foo.png';

        $img = $this->manager()->make('tests/images/trim.png');
<?php         $this->assertEquals($img->filename, 'foo');

        $this->assertEquals($img->mime, 'image/png');

        $this->assertFileExists($save_as);

        @unlink($save_as);



        $save_as = 'tests/tmp/foo.jpg';

        $img = $this->manager()->make('tests/images/trim.png');
<?php         $this->assertEquals($img->filename, 'foo');

        $this->assertEquals($img->mime, 'image/jpeg');

        $this->assertFileExists($save_as);

        @unlink($save_as);

    }



    public function testSaveImageWithoutParameter()
<?php         $this->assertColorAtPosition('#00ff00', $img, 0, 0);

        $img->destroy();



        @unlink($path);

    }



    public function testDestroy()
<?php         $img = $this->manager()->make($save_as);

        $this->assertTransparentPosition($img, 0, 0);

        @unlink($save_as);

    }



    private function assertColorAtPosition($color, $img, $x, $y)
<?php         $this->assertEquals($image->basename, 'test.jpg');

        $this->assertEquals($image->extension, 'jpg');

        $this->assertEquals($image->filename, 'test');

        @unlink($save_as);

    }



    public function testFormatSave()
<?php         $image->save($save_as, null, 'jpg');



        $this->assertEquals(\mime_content_type($save_as), 'image/jpeg');

        @unlink($save_as);

    }



    public function testIsEncoded()
<?php         $this->assertEquals($img->extension, 'jpg');

        $this->assertEquals($img->filename, 'foo');

        $this->assertEquals($img->mime, 'image/jpeg');

        @unlink($save_as);



        $save_as = 'tests/tmp/foo.png';

        $img = $this->manager()->make('tests/images/trim.png');
<?php         $this->assertEquals($img->filename, 'foo');

        $this->assertEquals($img->mime, 'image/png');

        $this->assertFileExists($save_as);

        @unlink($save_as);



        $save_as = 'tests/tmp/foo.jpg';

        $img = $this->manager()->make('tests/images/trim.png');
<?php         $this->assertEquals($img->filename, 'foo');

        $this->assertEquals($img->mime, 'image/jpeg');

        $this->assertFileExists($save_as);

        @unlink($save_as);

    }



    public function testSaveImageWithoutParameter()
<?php         $this->assertColorAtPosition('#00ff00', $img, 0, 0);

        $img->destroy();



        @unlink($path);

    }
<?php         $img = $this->manager()->make($save_as);

        $this->assertTransparentPosition($img, 0, 0);

        @unlink($save_as);

    }



    private function assertColorAtPosition($color, $img, $x, $y)