root/cleversvg/trunk/tests/csPolylineTest.php

Revision 336, 0.8 kB (checked in by nperriault, 10 months ago)

Clever Svg:

  • refs #40: more elements tests
  • Removed depth management, as svg handle it natively

Warning: breaks BC from 0.5.

Line 
1 <?php
2 require_once 'PHPUnit/Framework.php';
3 require_once dirname(__FILE__).'/../cleversvg.php';
4 require_once dirname(__FILE__).'/csBaseTestCase.class.php';
5
6 /**
7  * csPolyline PHPUnit tests
8  *
9  */
10 class csPolylineTest extends csBaseTestCase
11 {
12
13   public function testDrawing()
14   {
15     $doc = new csDocument(320, 240, 'Blah');
16     $poly = new csPolyline();
17     $poly->setPointsArray(array(array(1, 2), array(3, 4)));
18     $doc->addElement($poly);
19     $this->assertAttrValueEquals($doc, '/svg:svg/svg:polyline/@points', '1,2 3,4');
20   }
21
22   public function testSetters()
23   {
24     $doc = new csDocument(320, 240, 'Blah');
25     $poly = new csPolyline();
26     $poly->setX(1);
27     $poly->setY(2);
28     $doc->addElement($poly);
29     $this->assertAttrValueEquals($doc, '/svg:svg/svg:polyline/@x', 1);
30     $this->assertAttrValueEquals($doc, '/svg:svg/svg:polyline/@y', 2);
31   }
32
33 }
34
Note: See TracBrowser for help on using the browser.