/** * Tests the getSize() method. * * @param string $value * @param int $expected * * @dataProvider getGetSizePixelValues */ public function testGetSizePixelValues($value, $expected) { $imagine = new Imagine(); $image = $imagine->create(new Box(100, 100)); $document = $image->getDomDocument(); $document->documentElement->setAttribute('width', $value); $document->documentElement->setAttribute('height', $value); $this->assertEquals($expected, $image->getSize()->getWidth()); $this->assertEquals($expected, $image->getSize()->getHeight()); }
/** * Tests the create() method with a color. */ public function testCreateWithColor() { $color = $this->getMock('Imagine\\Image\\Palette\\Color\\ColorInterface'); $this->setExpectedException('Imagine\\Exception\\InvalidArgumentException'); $this->imagine->create(new Box(100, 100), $color); }