Joli\GifExceptionBundle\Tests\Command\GifOptimizerCommandTest::testGifIsResizedToExpectedWidth PHP Method

testGifIsResizedToExpectedWidth() public method

    public function testGifIsResizedToExpectedWidth()
    {
        list($originalWidth) = getimagesize($this->testGif);
        $expectedWidth = 145;
        $command = new GifOptimizerCommand();
        $args = array('image_dir' => __DIR__);
        $options = array('resize_width' => $expectedWidth);
        try {
            $this->getOutputForCommand($command, GifOptimizerCommand::COMMAND_NAME, $args, $options);
        } catch (CommandNotFound $e) {
            $this->markTestSkipped(sprintf('Gif optimizer tool is not executable'));
        }
        clearstatcache(true, $this->testGif);
        list($optimizedWidth) = getimagesize($this->testGif);
        self::assertEquals($expectedWidth, $optimizedWidth);
        self::assertNotEquals($originalWidth, $optimizedWidth);
    }