From c0cff04fba123dce9b91ecf13282571debbe6e6a Mon Sep 17 00:00:00 2001 From: tof <> Date: Tue, 11 Dec 2007 07:33:26 +0000 Subject: Clean up some unit tests to allow them run with PHPUnit 3.1+ --- tests/unit/Web/UI/THtmlWriterTest.php | 12 ++++++------ tests/unit/Xml/TXmlElementListTest.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/unit/Web/UI/THtmlWriterTest.php b/tests/unit/Web/UI/THtmlWriterTest.php index fa5bb954..ddbdabcf 100644 --- a/tests/unit/Web/UI/THtmlWriterTest.php +++ b/tests/unit/Web/UI/THtmlWriterTest.php @@ -66,7 +66,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer=new THtmlWriter(self::$output); $writer->addAttributes(array ('type' => 'text', 'value' => 'Prado & Cie')); // get the private var _attributes - $result=self::getAttribute($writer, '_attributes'); + $result=self::readAttribute($writer, '_attributes'); self::assertEquals('text',$result['type']); self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']); } @@ -75,7 +75,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer=new THtmlWriter(self::$output); $writer->addAttribute('type','text'); $writer->addAttribute('value','Prado & Cie'); - $result=self::getAttribute($writer, '_attributes'); + $result=self::readAttribute($writer, '_attributes'); self::assertEquals('text',$result['type']); self::assertEquals(THttpUtility::htmlEncode('Prado & Cie'), $result['value']); } @@ -85,7 +85,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer->addAttribute('type','text'); $writer->addAttribute('value','Prado & Cie'); $writer->removeAttribute('value'); - $result=self::getAttribute($writer, '_attributes'); + $result=self::readAttribute($writer, '_attributes'); // 'type' should be present, 'value' not self::assertTrue(isset($result['type'])); self::assertFalse(isset($result['value'])); @@ -94,7 +94,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { public function testAddStyleAttributes() { $writer=new THtmlWriter(self::$output); $writer->addStyleAttributes(array ('font-size' => '1em', 'background-image'=>'url(image.gif)')); - $result=self::getAttribute($writer, '_styles'); + $result=self::readAttribute($writer, '_styles'); self::assertEquals('1em', $result['font-size']); self::assertEquals(THttpUtility::htmlEncode('url(image.gif)'), $result['background-image']); } @@ -103,7 +103,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer=new THtmlWriter(self::$output); $writer->addStyleAttribute('font-size','1em'); $writer->addStyleAttribute('background-image','url(image.gif)'); - $result=self::getAttribute($writer, '_styles'); + $result=self::readAttribute($writer, '_styles'); self::assertEquals('1em', $result['font-size']); self::assertEquals(THttpUtility::htmlEncode('url(image.gif)'), $result['background-image']); } @@ -113,7 +113,7 @@ class THtmlWriterTest extends PHPUnit_Framework_TestCase { $writer->addStyleAttribute('font-size','1em'); $writer->addStyleAttribute('background-image','url(image.gif)'); $writer->removeStyleAttribute('font-size'); - $result=self::getAttribute($writer, '_styles'); + $result=self::readAttribute($writer, '_styles'); self::assertTrue(isset($result['background-image'])); self::assertFalse(isset($result['font-size'])); } diff --git a/tests/unit/Xml/TXmlElementListTest.php b/tests/unit/Xml/TXmlElementListTest.php index 91e09267..16384078 100644 --- a/tests/unit/Xml/TXmlElementListTest.php +++ b/tests/unit/Xml/TXmlElementListTest.php @@ -11,7 +11,7 @@ class TXmlElementListTest extends PHPUnit_Framework_TestCase { public function testConstruct() { $element=new TXmlElement('tag'); $list=new TXmlElementList($element); - self::assertEquals($element,self::getAttribute($list, '_o')); + self::assertEquals($element,self::readAttribute($list, '_o')); } public function testInsertAt() { -- cgit v1.2.3