From b6ec303f50cfa233374d12b06a539025da70e303 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 21 May 2011 21:26:33 +0000 Subject: up-ported to trunk/ unit tests fixes from r2921 --- tests/unit/Collections/TPagedListTest.php | 2 +- tests/unit/Collections/TQueueTest.php | 2 +- tests/unit/Collections/TStackTest.php | 2 +- tests/unit/Data/SqlMap/AllTests.php | 4 ++-- tests/unit/Prado.php | 6 +++--- tests/unit/Util/TDateTimeStampTest.php | 2 +- tests/unit/Web/UI/WebControls/TDropDownListTest.php | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/unit/Collections/TPagedListTest.php b/tests/unit/Collections/TPagedListTest.php index dc567e55..2f1b40cc 100644 --- a/tests/unit/Collections/TPagedListTest.php +++ b/tests/unit/Collections/TPagedListTest.php @@ -172,7 +172,7 @@ class TPagedListTest extends PHPUnit_Framework_TestCase { public function testGetIterator() { $list = new TPagedList(array(1, 2)); $list->CustomPaging = true; - self::assertType('TListIterator', $list->getIterator()); + self::assertType('ArrayIterator', $list->getIterator()); $n = 0; $found = 0; foreach($list as $index => $item) { diff --git a/tests/unit/Collections/TQueueTest.php b/tests/unit/Collections/TQueueTest.php index d04f647e..c5ec2b6b 100644 --- a/tests/unit/Collections/TQueueTest.php +++ b/tests/unit/Collections/TQueueTest.php @@ -96,7 +96,7 @@ class TQueueTest extends PHPUnit_Framework_TestCase { public function testGetIterator() { $queue = new TQueue(array(1, 2)); - self::assertType('TQueueIterator', $queue->getIterator()); + self::assertType('ArrayIterator', $queue->getIterator()); $n = 0; $found = 0; foreach($queue as $index => $item) { diff --git a/tests/unit/Collections/TStackTest.php b/tests/unit/Collections/TStackTest.php index e4c4e5d1..77fb1c97 100644 --- a/tests/unit/Collections/TStackTest.php +++ b/tests/unit/Collections/TStackTest.php @@ -96,7 +96,7 @@ class TStackTest extends PHPUnit_Framework_TestCase { public function testGetIterator() { $stack = new TStack(array(1, 2)); - self::assertType('TStackIterator', $stack->getIterator()); + self::assertType('ArrayIterator', $stack->getIterator()); $n = 0; $found = 0; foreach($stack as $index => $item) { diff --git a/tests/unit/Data/SqlMap/AllTests.php b/tests/unit/Data/SqlMap/AllTests.php index 735f1202..66f02608 100644 --- a/tests/unit/Data/SqlMap/AllTests.php +++ b/tests/unit/Data/SqlMap/AllTests.php @@ -6,7 +6,7 @@ if(!defined('PHPUnit_MAIN_METHOD')) { } require_once 'DynamicParameterTest.php'; -require_once './DataMapper/AllTests.php'; +require_once 'DataMapper/AllTests.php'; class Data_SqlMap_AllTests { @@ -27,4 +27,4 @@ class Data_SqlMap_AllTests { if(PHPUnit_MAIN_METHOD == 'Data_SqlMap_AllTests::main') { Data_SqlMap_AllTests::main(); } -?> \ No newline at end of file +?> diff --git a/tests/unit/Prado.php b/tests/unit/Prado.php index 9e73c934..6368a086 100644 --- a/tests/unit/Prado.php +++ b/tests/unit/Prado.php @@ -19,7 +19,7 @@ class Prado extends PradoBase { return self::$_application; } - public static function using($namespace) + public static function using($namespace,$checkClassExistence=true) { if(isset(self::$_usings[$namespace]) || class_exists($namespace,false)) return; @@ -133,7 +133,7 @@ class Prado extends PradoBase { $languages=array(); foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) { - $array=split(';q=',trim($language)); + $array=explode(';q=',trim($language)); $languages[trim($array[0])]=isset($array[1])?(float)$array[1]:1.0; } arsort($languages); @@ -147,4 +147,4 @@ class Prado extends PradoBase { } -?> \ No newline at end of file +?> diff --git a/tests/unit/Util/TDateTimeStampTest.php b/tests/unit/Util/TDateTimeStampTest.php index 5d296a83..8c6baf03 100644 --- a/tests/unit/Util/TDateTimeStampTest.php +++ b/tests/unit/Util/TDateTimeStampTest.php @@ -68,7 +68,7 @@ class TDateTimeStampTest extends PHPUnit_Framework_TestCase { $this->assertEquals($s->get4DigitYear(10), 2010, "Err 2-digit 2010"); $this->assertEquals($s->get4DigitYear(20), 2020, "Err 2-digit 2020"); $this->assertEquals($s->get4DigitYear(30), 2030, "Err 2-digit 2030"); - $this->assertEquals($s->get4DigitYear(40), 1940, "Err 2-digit 1940"); + $this->assertEquals($s->get4DigitYear(40), 2040, "Err 2-digit 2040"); $this->assertEquals($s->get4DigitYear(50), 1950, "Err 2-digit 1950"); $this->assertEquals($s->get4DigitYear(90), 1990, "Err 2-digit 1990"); } diff --git a/tests/unit/Web/UI/WebControls/TDropDownListTest.php b/tests/unit/Web/UI/WebControls/TDropDownListTest.php index 3db425b9..98ff1dd2 100644 --- a/tests/unit/Web/UI/WebControls/TDropDownListTest.php +++ b/tests/unit/Web/UI/WebControls/TDropDownListTest.php @@ -15,7 +15,7 @@ class TDropDownListTest extends PHPUnit_Framework_TestCase { 'c' => 3); $list->setDataSource($data); $list->dataBind(); - $items =& $list->getItems(); + $items = $list->getItems(); $this->assertTrue($items instanceof TListItemCollection); $expected_keys = array_keys($data); $i = 0; @@ -27,4 +27,4 @@ class TDropDownListTest extends PHPUnit_Framework_TestCase { } } -?> \ No newline at end of file +?> -- cgit v1.2.3