Elcodi\Bundle\MediaBundle\Tests\Functional\Services\ImageServiceTest::testCreateImage PHP Метод

testCreateImage() публичный Метод

Test image object creation.
public testCreateImage ( )
    public function testCreateImage()
    {
        $imagePath = __DIR__ . '/images/image-10-10.gif';
        $file = new File($imagePath);
        /**
         * @var ImageInterface $image
         */
        $image = $this->get('elcodi.manager.media_image')->createImage($file);
        $this->assertInstanceOf('Elcodi\\Component\\Media\\Entity\\Interfaces\\ImageInterface', $image);
        $this->assertEquals($image->getWidth(), 10);
        $this->assertEquals($image->getHeight(), 10);
        $this->assertEquals($image->getContentType(), 'image/gif');
        $this->assertEquals($image->getExtension(), 'gif');
        $this->assertEquals($image->getSize(), 102);
    }
ImageServiceTest