コード例 #1
0
ファイル: ImageTest.php プロジェクト: contao/imagine-svg
 /**
  * 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());
 }
コード例 #2
0
ファイル: ImagineTest.php プロジェクト: contao/imagine-svg
 /**
  * Tests the font() method.
  */
 public function testFont()
 {
     $color = $this->getMock('Imagine\\Image\\Palette\\Color\\ColorInterface');
     $this->setExpectedException('Imagine\\Exception\\RuntimeException');
     $this->imagine->font($this->rootDir, 10, $color);
 }