Show
Ignore:
Timestamp:
03/01/08 22:10:54 (4 years ago)
Author:
nperriault
Message:

refs #40 - base xml related test case utilities

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cleversvg/trunk/tests/csCircleTest.php

    r326 r333  
    1818    $doc->addElement($circle); 
    1919    $xml = $doc->toXML(); 
    20     $this->assertEquals(preg_match('#id="testid"#s', $xml), 1, $xml); 
     20    $this->assertAttrValueEquals($doc, '/svg:svg/svg:circle/@id', 'testid'); 
    2121  } 
    2222 
    23   public function testSetStyle() 
     23  public function testSetStroke() 
     24  { 
     25    $doc = new csDocument(320, 240, 'Test document'); 
     26    $circle = new csCircle(); 
     27    $circle->setStroke(2); 
     28    $doc->addElement($circle); 
     29    $this->assertAttrValueEquals($doc, '/svg:svg/svg:circle/@stroke', 2); 
     30  } 
     31 
     32  public function testSetStrokeByStyle() 
    2433  { 
    2534    $doc = new csDocument(320, 240, 'Test document'); 
     
    2736    $circle->setStyle(array('stroke' => 2)); 
    2837    $doc->addElement($circle); 
    29     $xml = $doc->toXML(); 
    30     $this->assertEquals(preg_match('#<circle stroke="2"/>#s', $xml), 1, $xml); 
     38    $this->assertAttrValueEquals($doc, '/svg:svg/svg:circle/@stroke', 2); 
    3139  } 
    3240