Przeglądaj źródła

[GENERIC] Barcode: complete SVG renderer tests

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23000 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 15 lat temu
rodzic
commit
0708074690
1 zmienionych plików z 34 dodań i 0 usunięć
  1. 34 0
      tests/Zend/Barcode/Renderer/SvgTest.php

+ 34 - 0
tests/Zend/Barcode/Renderer/SvgTest.php

@@ -48,6 +48,40 @@ class Zend_Barcode_Renderer_SvgTest extends Zend_Barcode_Renderer_TestCommon
         $this->assertSame('svg', $this->_renderer->getType());
     }
 
+    public function testGoodHeight()
+    {
+        $this->assertSame(0, $this->_renderer->getHeight());
+        $this->_renderer->setHeight(123);
+        $this->assertSame(123, $this->_renderer->getHeight());
+        $this->_renderer->setHeight(0);
+        $this->assertSame(0, $this->_renderer->getHeight());
+    }
+
+    /**
+     * @expectedException Zend_Barcode_Renderer_Exception
+     */
+    public function testBadHeight()
+    {
+        $this->_renderer->setHeight(-1);
+    }
+
+    public function testGoodWidth()
+    {
+        $this->assertSame(0, $this->_renderer->getWidth());
+        $this->_renderer->setWidth(123);
+        $this->assertSame(123, $this->_renderer->getWidth());
+        $this->_renderer->setWidth(0);
+        $this->assertSame(0, $this->_renderer->getWidth());
+    }
+
+    /**
+     * @expectedException Zend_Barcode_Renderer_Exception
+     */
+    public function testBadWidth()
+    {
+        $this->_renderer->setWidth(-1);
+    }
+    
     public function testGoodSvgResource()
     {
         $svgResource = new DOMDocument();