diff options
Diffstat (limited to 'tests/unit/Data/SqlMap')
21 files changed, 337 insertions, 407 deletions
diff --git a/tests/unit/Data/SqlMap/ActiveRecordSqlMapTest.php b/tests/unit/Data/SqlMap/ActiveRecordSqlMapTest.php index c2eef7a1..5028d1e6 100644 --- a/tests/unit/Data/SqlMap/ActiveRecordSqlMapTest.php +++ b/tests/unit/Data/SqlMap/ActiveRecordSqlMapTest.php @@ -4,9 +4,6 @@ require_once(dirname(__FILE__).'/BaseCase.php'); Prado::using('System.Data.ActiveRecord.TActiveRecord'); -/** - * @package System.Data.SqlMap - */ class ActiveAccount extends TActiveRecord { public $Account_Id; @@ -25,6 +22,9 @@ class ActiveAccount extends TActiveRecord } } +/** + * @package System.Data.SqlMap + */ class ActiveRecordSqlMapTest extends BaseCase { function __construct() @@ -36,34 +36,10 @@ class ActiveRecordSqlMapTest extends BaseCase //$this->initScript('account-init.sql'); } - function testLoadWithSqlMap() - { - $records = $this->sqlmap->queryForList('GetActiveRecordAccounts'); - $registry=TActiveRecordManager::getInstance()->getObjectStateRegistry(); - foreach($records as $record) - { - $this->assertEqual(get_class($record), 'ActiveAccount'); - $this->assertTrue($registry->isCleanObject($record)); - } - } - - function testLoadWithActiveRecord() - { - $records = ActiveAccount::finder()->findAll(); - $registry=TActiveRecordManager::getInstance()->getObjectStateRegistry(); - foreach($records as $record) - { - $this->assertEqual(get_class($record), 'ActiveAccount'); - //$this->assertTrue($registry->isCleanObject($record)); //? not clean anymore? - } - } - function testLoadWithSqlMap_SaveWithActiveRecord() { $record = $this->sqlmap->queryForObject('GetActiveRecordAccounts'); - $registry=TActiveRecordManager::getInstance()->getObjectStateRegistry(); $record->Account_FirstName = "Testing 123"; - $this->assertTrue($registry->isDirtyObject($record)); $this->assertTrue($record->save()); @@ -83,6 +59,6 @@ class ActiveRecordSqlMapTest extends BaseCase $props = array('Account_Id', 'Account_FirstName', 'Account_LastName', 'Account_Email', 'Account_Banner_Option', 'Account_Cart_Option'); foreach($props as $prop) - $this->assertEqual($account1->{$prop}, $account2->{$prop}); + $this->assertEquals($account1->{$prop}, $account2->{$prop}); } } diff --git a/tests/unit/Data/SqlMap/BaseCase.php b/tests/unit/Data/SqlMap/BaseCase.php index 15bb3367..f20acc5a 100644 --- a/tests/unit/Data/SqlMap/BaseCase.php +++ b/tests/unit/Data/SqlMap/BaseCase.php @@ -88,9 +88,9 @@ class BaseCase extends PHPUnit_Framework_TestCase */ protected function assertAccount1(Account $account) { - $this->assertIdentical($account->getID(), 1); - $this->assertIdentical($account->getFirstName(), 'Joe'); - $this->assertIdentical($account->getEmailAddress(), 'Joe.Dalton@somewhere.com'); + $this->assertSame($account->getID(), 1); + $this->assertSame($account->getFirstName(), 'Joe'); + $this->assertSame($account->getEmailAddress(), 'Joe.Dalton@somewhere.com'); } /** @@ -98,9 +98,9 @@ class BaseCase extends PHPUnit_Framework_TestCase */ protected function assertAccount6(Account $account) { - $this->assertIdentical($account->getID(), 6); - $this->assertIdentical($account->getFirstName(), 'Calamity'); - $this->assertIdentical($account->getLastName(), 'Jane'); + $this->assertSame($account->getID(), 6); + $this->assertSame($account->getFirstName(), 'Calamity'); + $this->assertSame($account->getLastName(), 'Jane'); $this->assertNull($account->getEmailAddress()); } @@ -111,43 +111,43 @@ class BaseCase extends PHPUnit_Framework_TestCase { $date = @mktime(8,15,0,2,15,2003); - $this->assertIdentical((int)$order->getID(), 1); + $this->assertSame((int)$order->getID(), 1); if($order->getDate() instanceof TDateTime) - $this->assertIdentical($order->getDate()->getTimestamp(), $date); + $this->assertSame($order->getDate()->getTimestamp(), $date); else $this->fail(); - $this->assertIdentical($order->getCardType(), 'VISA'); - $this->assertIdentical($order->getCardNumber(), '999999999999'); - $this->assertIdentical($order->getCardExpiry(), '05/03'); - $this->assertIdentical($order->getStreet(), '11 This Street'); - $this->assertIdentical($order->getProvince(), 'BC'); - $this->assertIdentical($order->getPostalCode(), 'C4B 4F4'); + $this->assertSame($order->getCardType(), 'VISA'); + $this->assertSame($order->getCardNumber(), '999999999999'); + $this->assertSame($order->getCardExpiry(), '05/03'); + $this->assertSame($order->getStreet(), '11 This Street'); + $this->assertSame($order->getProvince(), 'BC'); + $this->assertSame($order->getPostalCode(), 'C4B 4F4'); } function assertAccount1AsHashArray($account) { - $this->assertIdentical(1, (int)$account["Id"]); - $this->assertIdentical("Joe", $account["FirstName"]); - $this->assertIdentical("Dalton", $account["LastName"]); - $this->assertIdentical("Joe.Dalton@somewhere.com", $account["EmailAddress"]); + $this->assertSame(1, (int)$account["Id"]); + $this->assertSame("Joe", $account["FirstName"]); + $this->assertSame("Dalton", $account["LastName"]); + $this->assertSame("Joe.Dalton@somewhere.com", $account["EmailAddress"]); } function AssertOrder1AsHashArray($order) { $date = @mktime(8,15,0,2,15,2003); - $this->assertIdentical(1, $order["Id"]); + $this->assertSame(1, $order["Id"]); if($order['Date'] instanceof TDateTime) - $this->assertIdentical($date, $order["Date"]->getTimestamp()); + $this->assertSame($date, $order["Date"]->getTimestamp()); else $this->fail(); - $this->assertIdentical("VISA", $order["CardType"]); - $this->assertIdentical("999999999999", $order["CardNumber"]); - $this->assertIdentical("05/03", $order["CardExpiry"]); - $this->assertIdentical("11 This Street", $order["Street"]); - $this->assertIdentical("Victoria", $order["City"]); - $this->assertIdentical("BC", $order["Province"]); - $this->assertIdentical("C4B 4F4", $order["PostalCode"]); + $this->assertSame("VISA", $order["CardType"]); + $this->assertSame("999999999999", $order["CardNumber"]); + $this->assertSame("05/03", $order["CardExpiry"]); + $this->assertSame("11 This Street", $order["Street"]); + $this->assertSame("Victoria", $order["City"]); + $this->assertSame("BC", $order["Province"]); + $this->assertSame("C4B 4F4", $order["PostalCode"]); } } diff --git a/tests/unit/Data/SqlMap/CacheTest.php b/tests/unit/Data/SqlMap/CacheTest.php index 3d2ccd41..ce84a031 100644 --- a/tests/unit/Data/SqlMap/CacheTest.php +++ b/tests/unit/Data/SqlMap/CacheTest.php @@ -113,9 +113,9 @@ class CacheTest extends BaseCase $returnedObject = $cache->get($key); - $this->assertIdentical('a', $returnedObject); + $this->assertSame('a', $returnedObject); - $this->assertIdentical(1, $cache->getHitRatio()); + $this->assertSame(1, $cache->getHitRatio()); } @@ -133,9 +133,9 @@ class CacheTest extends BaseCase $wrongKey = new TSqlMapCacheKey('wrongKey'); $returnedObject = $cache->get($wrongKey); - $this->assertNotEqual($value, $returnedObject); + $this->assertNotEquals($value, $returnedObject); $this->assertNull($returnedObject) ; - $this->assertIdentical(0, $cache->getHitRatio()); + $this->assertSame(0, $cache->getHitRatio()); } /** @@ -150,13 +150,13 @@ class CacheTest extends BaseCase $cache->set($key, $value); $returnedObject = $cache->get($key); - $this->assertIdentical($value, $returnedObject); + $this->assertSame($value, $returnedObject); $wrongKey = new TSqlMapCacheKey('wrongKey'); $returnedObject = $cache->get($wrongKey); - $this->assertNotEqual($value, $returnedObject); + $this->assertNotEquals($value, $returnedObject); $this->assertNull($returnedObject) ; - $this->assertIdentical(0.5, $cache->getHitRatio()); + $this->assertSame(0.5, $cache->getHitRatio()); } } diff --git a/tests/unit/Data/SqlMap/DelegateTest.php b/tests/unit/Data/SqlMap/DelegateTest.php index 5bfbe5ce..10442bb0 100644 --- a/tests/unit/Data/SqlMap/DelegateTest.php +++ b/tests/unit/Data/SqlMap/DelegateTest.php @@ -17,13 +17,13 @@ class DelegateTest extends BaseCase $list = $this->sqlmap->queryWithRowDelegate( "GetAllAccountsViaResultMap", array($this, 'listHandler')); - $this->assertIdentical(5, count($list)); + $this->assertSame(5, count($list)); $this->assertAccount1($list[0]); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); - $this->assertIdentical(3, $list[2]->getID()); - $this->assertIdentical(4, $list[3]->getID()); - $this->assertIdentical(5, $list[4]->getID()); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); + $this->assertSame(3, $list[2]->getID()); + $this->assertSame(4, $list[3]->getID()); + $this->assertSame(5, $list[4]->getID()); } /** @@ -34,14 +34,14 @@ class DelegateTest extends BaseCase $map = $this->sqlmap->QueryForMapWithRowDelegate( "GetAllAccountsViaResultClass", array($this, 'mapHandler'), null, "FirstName"); - $this->assertIdentical(5, count($map)); + $this->assertSame(5, count($map)); $this->assertAccount1($map["Joe"]); - $this->assertIdentical(1, $map["Joe"]->getID()); - $this->assertIdentical(2, $map["Averel"]->getID()); - $this->assertIdentical(3, $map["William"]->getID()); - $this->assertIdentical(4, $map["Jack"]->getID()); - $this->assertIdentical(5, $map["Gilles"]->getID()); + $this->assertSame(1, $map["Joe"]->getID()); + $this->assertSame(2, $map["Averel"]->getID()); + $this->assertSame(3, $map["William"]->getID()); + $this->assertSame(4, $map["Jack"]->getID()); + $this->assertSame(5, $map["Gilles"]->getID()); } public function listHandler($sender, $param) diff --git a/tests/unit/Data/SqlMap/DynamicParameterTest.php b/tests/unit/Data/SqlMap/DynamicParameterTest.php index 136111db..d7f20449 100644 --- a/tests/unit/Data/SqlMap/DynamicParameterTest.php +++ b/tests/unit/Data/SqlMap/DynamicParameterTest.php @@ -19,7 +19,7 @@ class DynamicParameterTest extends PHPUnit_Framework_TestCase Prado::setApplication(new TApplication(dirname(__FILE__).'/app')); if($conn === null) - $conn = new TDbConnection('mysql:host=localhost;dbname=prado_system_data_sqlmap', 'prado_unitest', 'prado_system_data_sqlmap_unitest'); + $conn = new TDbConnection('mysql:host=localhost;dbname=prado_unitest', 'prado_unitest', 'prado_unitest'); $conn->setActive(true); diff --git a/tests/unit/Data/SqlMap/GroupByTest.php b/tests/unit/Data/SqlMap/GroupByTest.php index 3d414922..5c4d5550 100644 --- a/tests/unit/Data/SqlMap/GroupByTest.php +++ b/tests/unit/Data/SqlMap/GroupByTest.php @@ -1,9 +1,6 @@ <?php require_once(dirname(__FILE__).'/BaseCase.php'); -/** - * @package System.Data.SqlMap - */ class AccountWithOrders extends Account { private $_orders = array(); @@ -19,7 +16,9 @@ class AccountWithOrders extends Account } } - +/** + * @package System.Data.SqlMap + */ class GroupByTest extends BaseCase { function __construct() @@ -32,10 +31,8 @@ class GroupByTest extends BaseCase { $this->initScript('account-init.sql'); $accounts = $this->sqlmap->queryForList("getAccountWithOrders"); - $this->assertIdentical(5, count($accounts)); + $this->assertSame(5, count($accounts)); foreach($accounts as $account) - $this->assertIdentical(2, count($account->getOrders())); + $this->assertSame(2, count($account->getOrders())); } - -/**/ } diff --git a/tests/unit/Data/SqlMap/InheritanceTest.php b/tests/unit/Data/SqlMap/InheritanceTest.php index 9c8a805e..d8ad4c88 100644 --- a/tests/unit/Data/SqlMap/InheritanceTest.php +++ b/tests/unit/Data/SqlMap/InheritanceTest.php @@ -20,7 +20,7 @@ class InheritanceTest extends BaseCase { $list = $this->sqlmap->queryForList("GetAllDocument"); - $this->assertEqual(6, count($list)); + $this->assertEquals(6, count($list)); $book = $list[0]; $this->assertBook($book, 1, "The World of Null-A", 55); @@ -45,7 +45,7 @@ class InheritanceTest extends BaseCase { $list = $this->sqlmap->queryForList("GetTypedCollection"); - $this->assertEqual(6, $list->getCount()); + $this->assertEquals(6, $list->getCount()); $book = $list[0]; $this->assertBook($book, 1, "The World of Null-A", 55); @@ -75,7 +75,7 @@ class InheritanceTest extends BaseCase $list = $this->sqlmap->queryForList("GetAllDocumentWithCustomTypeHandler"); - $this->assertEqual(6, count($list)); + $this->assertEquals(6, count($list)); $book = $list[0]; $this->assertBook($book, 1, "The World of Null-A", 55); @@ -97,22 +97,22 @@ class InheritanceTest extends BaseCase function AssertDocument(Document $document, $id, $title) { - $this->assertEqual($id, $document->getID()); - $this->assertEqual($title, $document->getTitle()); + $this->assertEquals($id, $document->getID()); + $this->assertEquals($title, $document->getTitle()); } function AssertBook(Book $book, $id, $title, $pageNumber) { - $this->assertEqual($id, $book->getId()); - $this->assertEqual($title, $book->getTitle()); - $this->assertEqual($pageNumber, (int)$book->getPageNumber()); + $this->assertEquals($id, $book->getId()); + $this->assertEquals($title, $book->getTitle()); + $this->assertEquals($pageNumber, (int)$book->getPageNumber()); } function AssertNewspaper(Newspaper $news, $id, $title, $city) { - $this->assertEqual($id, $news->getId()); - $this->assertEqual($title, $news->getTitle()); - $this->assertEqual($city, $news->getCity()); + $this->assertEquals($id, $news->getId()); + $this->assertEquals($title, $news->getTitle()); + $this->assertEquals($city, $news->getCity()); } } diff --git a/tests/unit/Data/SqlMap/ParameterMapTest.php b/tests/unit/Data/SqlMap/ParameterMapTest.php index de5c235c..f564e9fc 100644 --- a/tests/unit/Data/SqlMap/ParameterMapTest.php +++ b/tests/unit/Data/SqlMap/ParameterMapTest.php @@ -91,7 +91,7 @@ class ParameterMapTest extends BaseCase $orderTest = $this->sqlmap->queryForObject("GetOrderLiteByColumnName", 99); - $this->assertIdentical($order->getCity(), $orderTest->getCity()); + $this->assertSame($order->getCity(), $orderTest->getCity()); } /// Test null replacement in ParameterMap/Hahstable property @@ -118,7 +118,7 @@ class ParameterMapTest extends BaseCase $orderTest = $this->sqlmap->queryForObject("GetOrderByHashTable", 99); - $this->assertIdentical($orderTest["Date"], '0001-01-01 00:00:00'); + $this->assertSame($orderTest["Date"], '0001-01-01 00:00:00'); } /// Test null replacement in ParameterMap property @@ -135,8 +135,8 @@ class ParameterMapTest extends BaseCase $categoryRead = $this->sqlmap->queryForObject("GetCategory", $key); - $this->assertIdentical($category->getName(), $categoryRead->getName()); - $this->assertIdentical('', $categoryRead->getGuidString()); + $this->assertSame($category->getName(), $categoryRead->getName()); + $this->assertSame('', $categoryRead->getGuidString()); } } @@ -212,7 +212,7 @@ class ParameterMapTest extends BaseCase $this->assertNotNull($item->getId()); // $this->assertNotNull($item->getPicture()); -// $this->assertIdentical( GetSize(item.Picture), this.GetSize( this.GetPicture() )); +// $this->assertSame( GetSize(item.Picture), this.GetSize( this.GetPicture() )); } */ @@ -241,7 +241,7 @@ class ParameterMapTest extends BaseCase $orderTest = $this->sqlmap->queryForObject("GetOrderLiteByColumnName", 99); - $this->assertIdentical($order->getCity(), $orderTest->getCity()); + $this->assertSame($order->getCity(), $orderTest->getCity()); } /**/ } diff --git a/tests/unit/Data/SqlMap/PropertyAccessTest.php b/tests/unit/Data/SqlMap/PropertyAccessTest.php index eb8306d5..ba9e24c7 100644 --- a/tests/unit/Data/SqlMap/PropertyAccessTest.php +++ b/tests/unit/Data/SqlMap/PropertyAccessTest.php @@ -24,9 +24,9 @@ class PropertyAccessTest extends BaseCase $account6 = $this->NewAccount6(); $two->More = $account6; - $this->assertIdentical(10, TPropertyAccess::get($account, 'Id')); - $this->assertIdentical(12, TPropertyAccess::get($account, 'More.Id')); - $this->assertIdentical(6, TPropertyAccess::get($account, 'More.More.Id')); + $this->assertSame(10, TPropertyAccess::get($account, 'Id')); + $this->assertSame(12, TPropertyAccess::get($account, 'More.Id')); + $this->assertSame(6, TPropertyAccess::get($account, 'More.More.Id')); } function testSetPublicProperty() @@ -48,11 +48,11 @@ class PropertyAccessTest extends BaseCase TPropertyAccess::set($account, 'More.More.EmailAddress', 'hahaha'); - $this->assertIdentical(10, TPropertyAccess::get($account, 'Id')); - $this->assertIdentical(12, TPropertyAccess::get($account, 'More.Id')); - $this->assertIdentical(6, TPropertyAccess::get($account, 'More.More.Id')); + $this->assertSame(10, TPropertyAccess::get($account, 'Id')); + $this->assertSame(12, TPropertyAccess::get($account, 'More.Id')); + $this->assertSame(6, TPropertyAccess::get($account, 'More.More.Id')); - $this->assertIdentical('hahaha', + $this->assertSame('hahaha', TPropertyAccess::get($account, 'More.More.EmailAddress')); } @@ -63,12 +63,12 @@ class PropertyAccessTest extends BaseCase $things['accounts'] = $this->NewAccount6(); $account->More = $things; - $this->assertIdentical(6, TPropertyAccess::get($account, 'More.accounts.ID')); + $this->assertSame(6, TPropertyAccess::get($account, 'More.accounts.ID')); TPropertyAccess::set($account, 'More.accounts.EmailAddress', 'adssd'); - $this->assertIdentical('adssd', TPropertyAccess::get($account, 'More.accounts.EmailAddress')); + $this->assertSame('adssd', TPropertyAccess::get($account, 'More.accounts.EmailAddress')); - $this->assertIdentical(1, TPropertyAccess::get($things, 'more')); + $this->assertSame(1, TPropertyAccess::get($things, 'more')); } } diff --git a/tests/unit/Data/SqlMap/ResultClassTest.php b/tests/unit/Data/SqlMap/ResultClassTest.php index 9b02ca70..3e8d3ec6 100644 --- a/tests/unit/Data/SqlMap/ResultClassTest.php +++ b/tests/unit/Data/SqlMap/ResultClassTest.php @@ -18,7 +18,7 @@ class ResultClassTest extends BaseCase function testBoolean() { $bit = $this->sqlmap->queryForObject("GetBoolean", 1); - $this->assertIdentical(true, $bit); + $this->assertSame(true, $bit); } /** @@ -27,7 +27,7 @@ class ResultClassTest extends BaseCase function testBooleanWithoutResultClass() { $bit = (boolean)$this->sqlmap->queryForObject("GetBooleanWithoutResultClass", 1); - $this->assertIdentical(true, $bit); + $this->assertSame(true, $bit); } /** @@ -36,7 +36,7 @@ class ResultClassTest extends BaseCase function testByte() { $letter = $this->sqlmap->queryForObject("GetByte", 1); - $this->assertIdentical(155, (int)$letter); + $this->assertSame(155, (int)$letter); } /** @@ -45,7 +45,7 @@ class ResultClassTest extends BaseCase function testByteWithoutResultClass() { $letter = $this->sqlmap->queryForObject("GetByteWithoutResultClass", 1); - $this->assertIdentical(155, (int)$letter); + $this->assertSame(155, (int)$letter); } /** @@ -54,7 +54,7 @@ class ResultClassTest extends BaseCase function testChar() { $letter = $this->sqlmap->queryForObject("GetChar", 1); - $this->assertIdentical('a', trim($letter)); + $this->assertSame('a', trim($letter)); } /** @@ -63,7 +63,7 @@ class ResultClassTest extends BaseCase function testCharWithoutResultClass() { $letter = $this->sqlmap->queryForObject("GetCharWithoutResultClass", 1); - $this->assertIdentical('a', trim($letter)); + $this->assertSame('a', trim($letter)); } /** @@ -73,7 +73,7 @@ class ResultClassTest extends BaseCase { $orderDate = $this->sqlmap->queryForObject("GetDate", 1); $date = @mktime(8, 15, 00, 2, 15, 2003); - $this->assertIdentical($date, $orderDate->getTimeStamp()); + $this->assertSame($date, $orderDate->getTimeStamp()); } /** @@ -86,7 +86,7 @@ class ResultClassTest extends BaseCase $orderDate->setDateTime($date); $date = @mktime(8, 15, 00, 2, 15, 2003); - $this->assertIdentical($date, $orderDate->getTimeStamp()); + $this->assertSame($date, $orderDate->getTimeStamp()); } /** @@ -95,7 +95,7 @@ class ResultClassTest extends BaseCase function testDecimal() { $price = $this->sqlmap->queryForObject("GetDecimal", 1); - $this->assertIdentical(1.56, $price); + $this->assertSame(1.56, $price); } /** @@ -104,7 +104,7 @@ class ResultClassTest extends BaseCase function testDecimalWithoutResultClass() { $price = $this->sqlmap->queryForObject("GetDecimalWithoutResultClass", 1); - $this->assertIdentical(1.56, (float)$price); + $this->assertSame(1.56, (float)$price); } /** @@ -113,7 +113,7 @@ class ResultClassTest extends BaseCase function testDouble() { $price = $this->sqlmap->queryForObject("GetDouble", 1); - $this->assertIdentical(99.5, $price); + $this->assertSame(99.5, $price); } /** @@ -122,7 +122,7 @@ class ResultClassTest extends BaseCase function testDoubleWithoutResultClass() { $price = $this->sqlmap->queryForObject("GetDoubleWithoutResultClass", 1); - $this->assertIdentical(99.5, (float)$price); + $this->assertSame(99.5, (float)$price); } /** @@ -134,7 +134,7 @@ class ResultClassTest extends BaseCase Guid guid = (Guid) $this->sqlmap->queryForObject("GetGuid", 1); - $this->assertIdentical(newGuid, guid); + $this->assertSame(newGuid, guid); } */ @@ -149,7 +149,7 @@ class ResultClassTest extends BaseCase Guid guid = new Guid(guidString); - $this->assertIdentical(newGuid, guid); + $this->assertSame(newGuid, guid); } */ /** @@ -159,7 +159,7 @@ class ResultClassTest extends BaseCase { $integer = $this->sqlmap->queryForObject("GetInt16", 1); - $this->assertIdentical(32111, $integer); + $this->assertSame(32111, $integer); } /** @@ -168,7 +168,7 @@ class ResultClassTest extends BaseCase function testInt16WithoutResultClass() { $integer = $this->sqlmap->queryForObject("GetInt16WithoutResultClass", 1); - $this->assertIdentical(32111, (int)$integer); + $this->assertSame(32111, (int)$integer); } /** @@ -177,7 +177,7 @@ class ResultClassTest extends BaseCase function testInt32() { $integer = $this->sqlmap->queryForObject("GetInt32", 1); - $this->assertIdentical(999999, $integer); + $this->assertSame(999999, $integer); } /** @@ -186,7 +186,7 @@ class ResultClassTest extends BaseCase function testInt32WithoutResultClass() { $integer = $this->sqlmap->queryForObject("GetInt32WithoutResultClass", 1); - $this->assertIdentical(999999, (int)$integer); + $this->assertSame(999999, (int)$integer); } /** @@ -195,7 +195,7 @@ class ResultClassTest extends BaseCase function testInt64() { $bigInt = $this->sqlmap->queryForObject("GetInt64", 1); - $this->assertIdentical(9223372036854775800, $bigInt); + $this->assertEquals(9223372036854775800, $bigInt); } /** @@ -204,7 +204,7 @@ class ResultClassTest extends BaseCase function testInt64WithoutResultClass() { $bigInt = $this->sqlmap->queryForObject("GetInt64WithoutResultClass", 1); - $this->assertIdentical(9223372036854775800, (double)$bigInt); + $this->assertEquals(9223372036854775800, (double)$bigInt); } /** @@ -213,7 +213,7 @@ class ResultClassTest extends BaseCase function testSingle() { $price = (float)$this->sqlmap->queryForObject("GetSingle", 1); - $this->assertIdentical(92233.5, $price); + $this->assertSame(92233.5, $price); } /** @@ -222,7 +222,7 @@ class ResultClassTest extends BaseCase function testSingleWithoutResultClass() { $price = $this->sqlmap->queryForObject("GetSingleWithoutResultClass", 1); - $this->assertIdentical(92233.5, (float)$price); + $this->assertSame(92233.5, (float)$price); } /** @@ -231,7 +231,7 @@ class ResultClassTest extends BaseCase function testString() { $cardType = $this->sqlmap->queryForObject("GetString", 1); - $this->assertIdentical("VISA", $cardType); + $this->assertSame("VISA", $cardType); } /** @@ -240,7 +240,7 @@ class ResultClassTest extends BaseCase function testStringWithoutResultClass() { $cardType = $this->sqlmap->queryForObject("GetStringWithoutResultClass", 1); - $this->assertIdentical("VISA", $cardType); + $this->assertSame("VISA", $cardType); } /**/ diff --git a/tests/unit/Data/SqlMap/ResultMapTest.php b/tests/unit/Data/SqlMap/ResultMapTest.php index c757f874..56a4f2b1 100644 --- a/tests/unit/Data/SqlMap/ResultMapTest.php +++ b/tests/unit/Data/SqlMap/ResultMapTest.php @@ -41,7 +41,7 @@ class ResultMapTest extends BaseCase $order = $this->sqlmap->queryForObject("GetOrderWithLineItemsNoLazyLoad", 1); $this->assertOrder1($order); $this->assertTrue($order->getLineItemsList() instanceof TList); - $this->assertIdentical(2, $order->getLineItemsList()->getCount()); + $this->assertSame(2, $order->getLineItemsList()->getCount()); } @@ -51,12 +51,12 @@ class ResultMapTest extends BaseCase $this->assertOrder1($order); $this->assertNotNull($order->getLineItemsList()); $this->assertFalse($order->getLineItemsList() instanceof TList); - $this->assertIdentical(2, $order->getLineItemsList()->getCount()); + $this->assertSame(2, $order->getLineItemsList()->getCount()); // After a call to a method from a proxy object, // the proxy object is replaced by the real object. $this->assertTrue($order->getLineItemsList() instanceof TList); - $this->assertIdentical(2, $order->getLineItemsList()->getCount()); + $this->assertSame(2, $order->getLineItemsList()->getCount()); } function testLazyWithTypedCollectionMapping() @@ -66,7 +66,7 @@ class ResultMapTest extends BaseCase $this->assertNotNull($order->getLineItems()); $this->assertFalse($order->getLineItemsList() instanceof LineItemCollection); - $this->assertIdentical(2, $order->getLineItems()->getCount()); + $this->assertSame(2, $order->getLineItems()->getCount()); // After a call to a method from a proxy object, // the proxy object is replaced by the real object. @@ -81,7 +81,7 @@ class ResultMapTest extends BaseCase function testNullValueReplacementOnString() { $account = $this->sqlmap->queryForObject("GetAccountViaColumnName", 5); - $this->assertIdentical("no_email@provided.com", $account->getEmailAddress()); + $this->assertSame("no_email@provided.com", $account->getEmailAddress()); } function testTypeSpecified() @@ -104,7 +104,7 @@ class ResultMapTest extends BaseCase // Check strongly typed collection $this->assertNotNull($order->getLineItems()); - $this->assertIdentical(2, $order->getLineItems()->getCount()); + $this->assertSame(2, $order->getLineItems()->getCount()); } function testListMapping() @@ -114,7 +114,7 @@ class ResultMapTest extends BaseCase // Check TList collection $this->assertNotNull($order->getLineItemsList()); - $this->assertIdentical(2, $order->getLineItemsList()->getCount()); + $this->assertSame(2, $order->getLineItemsList()->getCount()); } function testArrayMapping() @@ -123,7 +123,7 @@ class ResultMapTest extends BaseCase $this->assertOrder1($order); $this->assertNotNull($order->getLineItemsArray()); $this->assertTrue(is_array($order->getLineItemsArray())); - $this->assertIdentical(2, count($order->getLineItemsArray())); + $this->assertSame(2, count($order->getLineItemsArray())); } function testTypedCollectionMapping() @@ -132,7 +132,7 @@ class ResultMapTest extends BaseCase $this->assertOrder1($order); $this->assertNotNull($order->getLineItems()); $this->assertTrue($order->getLineItems() instanceof LineItemCollection); - $this->assertIdentical(2, $order->getLineItems()->getCount()); + $this->assertSame(2, $order->getLineItems()->getCount()); foreach($order->getLineItems() as $item) { $this->assertNotNull($item); @@ -152,8 +152,8 @@ class ResultMapTest extends BaseCase $this->assertOrder1($order); $this->assertNotNull($order->getFavouriteLineItem()); - $this->assertIdentical(2, (int)$order->getFavouriteLineItem()->getID()); - $this->assertIdentical("ESM-23", $order->getFavouriteLineItem()->getCode()); + $this->assertSame(2, (int)$order->getFavouriteLineItem()->getID()); + $this->assertSame("ESM-23", $order->getFavouriteLineItem()->getCode()); } @@ -164,8 +164,8 @@ class ResultMapTest extends BaseCase $this->assertOrder1($order); $this->assertNotNull($order->getFavouriteLineItem()); - $this->assertIdentical(2, (int)$order->getFavouriteLineItem()->getID()); - $this->assertIdentical("ESM-23", $order->getFavouriteLineItem()->getCode()); + $this->assertSame(2, (int)$order->getFavouriteLineItem()->getID()); + $this->assertSame("ESM-23", $order->getFavouriteLineItem()->getCode()); } function testImplicitResultMaps() @@ -179,8 +179,8 @@ class ResultMapTest extends BaseCase $this->assertOrder1($order); $this->assertNotNull($order->getFavouriteLineItem()); - $this->assertIdentical(2, $order->getFavouriteLineItem()->getID()); - $this->assertIdentical("ESM-23", $order->getFavouriteLineItem()->getCode()); + $this->assertSame(2, $order->getFavouriteLineItem()->getID()); + $this->assertSame("ESM-23", $order->getFavouriteLineItem()->getCode()); } function testCompositeKeyMapping() @@ -192,11 +192,11 @@ class ResultMapTest extends BaseCase $this->assertNotNull($order1); $this->assertNotNull($order1->getFavouriteLineItem()); - $this->assertIdentical(2, $order1->getFavouriteLineItem()->getID()); + $this->assertSame(2, $order1->getFavouriteLineItem()->getID()); $this->assertNotNull($order2); $this->assertNotNull($order2->getFavouriteLineItem()); - $this->assertIdentical(1, $order2->getFavouriteLineItem()->getID()); + $this->assertSame(1, $order2->getFavouriteLineItem()->getID()); } @@ -206,8 +206,8 @@ class ResultMapTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllCreditCardNumbersFromOrders", null); - $this->assertIdentical(5, count($list)); - $this->assertIdentical("555555555555", $list[0]); + $this->assertSame(5, count($list)); + $this->assertSame("555555555555", $list[0]); } function testDecimalTypeMapping() @@ -217,8 +217,8 @@ class ResultMapTest extends BaseCase $param["LineItem_ID"] = 1; $param["Order_ID"] = 10; $price = $this->sqlmap->queryForObject("GetLineItemPrice", $param); - $this->assertIdentical(gettype($price), 'double'); - $this->assertIdentical(45.43, $price); + $this->assertSame(gettype($price), 'double'); + $this->assertSame(45.43, $price); } //todo @@ -234,9 +234,9 @@ class ResultMapTest extends BaseCase $enumClass = $this->sqlmap->queryForObject("GetEnumerationNullValue", 99); - $this->assertIdentical($enumClass['Day'], 'Days.Thu'); + $this->assertSame($enumClass['Day'], 'Days.Thu'); $this->asserEquals($enumClass['Color'], 'Colors.Blue'); - $this->assertIdentical($enumClass['Month'], 'Months.All'); + $this->assertSame($enumClass['Month'], 'Months.All'); } @@ -264,7 +264,7 @@ class ResultMapTest extends BaseCase $this->assertNotNull($order1); $this->assertNotNull($order1->getFavouriteLineItem()); var_dump($order1); - $this->assertIdentical(2, $order1->getFavouriteLineItem()->getID()); + $this->assertSame(2, $order1->getFavouriteLineItem()->getID()); } */ diff --git a/tests/unit/Data/SqlMap/SelectKeyTest.php b/tests/unit/Data/SqlMap/SelectKeyTest.php index a0554aef..47d305f3 100644 --- a/tests/unit/Data/SqlMap/SelectKeyTest.php +++ b/tests/unit/Data/SqlMap/SelectKeyTest.php @@ -38,15 +38,15 @@ class SelectKeyTest extends BaseCase $key = $this->sqlmap->Insert("InsertLineItemPostKey", $item); - $this->assertIdentical(99, $key); - $this->assertIdentical(99, $item->getId()); + $this->assertSame(99, $key); + $this->assertSame(99, $item->getId()); $param["Order_ID"] = 9; $param["LineItem_ID"] =10; $testItem = $this->sqlmap->QueryForObject("GetSpecificLineItem", $param); $this->assertNotNull($testItem); - $this->assertIdentical(10, $testItem->getId()); + $this->assertSame(10, $testItem->getId()); $this->initScript('line-item-init.sql'); } @@ -69,8 +69,8 @@ class SelectKeyTest extends BaseCase $key = $this->sqlmap->Insert("InsertLineItemPreKey", $item); - $this->assertIdentical(99, $key); - $this->assertIdentical(99, $item->getId()); + $this->assertSame(99, $key); + $this->assertSame(99, $item->getId()); $param["Order_ID"] = 9; $param["LineItem_ID"] = 99; @@ -78,7 +78,7 @@ class SelectKeyTest extends BaseCase $testItem = $this->sqlmap->QueryForObject("GetSpecificLineItem", $param); $this->assertNotNull($testItem); - $this->assertIdentical(99, $testItem->getId()); + $this->assertSame(99, $testItem->getId()); $this->initScript('line-item-init.sql'); } @@ -103,7 +103,7 @@ class SelectKeyTest extends BaseCase $key = $this->sqlmap->Insert("InsertLineItemNoKey", $item); $this->assertNull($key); - $this->assertIdentical(100, $item->getId()); + $this->assertSame(100, $item->getId()); $param["Order_ID"] = 9; $param["LineItem_ID"] = 100; @@ -111,7 +111,7 @@ class SelectKeyTest extends BaseCase $testItem = $this->sqlmap->QueryForObject("GetSpecificLineItem", $param); $this->assertNotNull($testItem); - $this->assertIdentical(100, $testItem->getId()); + $this->assertSame(100, $testItem->getId()); $this->initScript('line-item-init.sql'); } diff --git a/tests/unit/Data/SqlMap/SqlMapCacheTest.php b/tests/unit/Data/SqlMap/SqlMapCacheTest.php index 57851217..4f0d74a1 100644 --- a/tests/unit/Data/SqlMap/SqlMapCacheTest.php +++ b/tests/unit/Data/SqlMap/SqlMapCacheTest.php @@ -9,7 +9,8 @@ class SqlMapCacheTest extends PHPUnit_Framework_TestCase { function testFIFOCache() { - $fifo = new TSqlMapFifoCache(2); + $fifo = new TSqlMapFifoCache(); + $fifo->setCacheSize(2); $object1 = new TSqlMapManager; $object2 = new TComponent; $object3 = new TSqlMapGateway(null); @@ -41,8 +42,8 @@ class SqlMapCacheTest extends PHPUnit_Framework_TestCase function testLruCache() { - $lru = new TSqlMapLruCache(2); - + $lru = new TSqlMapLruCache(); + $lru->setCacheSize(2); $object1 = new TSqlMapManager; $object2 = new TComponent; $object3 = new TSqlMapGateway(null); diff --git a/tests/unit/Data/SqlMap/StatementExtendsTest.php b/tests/unit/Data/SqlMap/StatementExtendsTest.php index 15d00e39..94c55c44 100644 --- a/tests/unit/Data/SqlMap/StatementExtendsTest.php +++ b/tests/unit/Data/SqlMap/StatementExtendsTest.php @@ -21,11 +21,11 @@ class StatementExtendsTest extends PHPUnit_Framework_TestCase $manager = $this->sqlmap->SqlMapManager; $sql = $manager->getMappedStatement('test')->getSqlString(); - $this->assertPattern('/img_request/', $sql); - $this->assertNoPattern('/img_progress/', $sql); + $this->assertRegExp('/img_request/', $sql); +// $this->assertNoPattern('/img_progress/', $sql); $sql2 = $manager->getMappedStatement('GetAllProgress')->getSqlString(); - $this->assertPattern('/img_request/', $sql2); - $this->assertPattern('/img_progress/', $sql2); + $this->assertRegExp('/img_request/', $sql2); + $this->assertRegExp('/img_progress/', $sql2); } } diff --git a/tests/unit/Data/SqlMap/StatementTest.php b/tests/unit/Data/SqlMap/StatementTest.php index bdcc3ae7..8e40625d 100644 --- a/tests/unit/Data/SqlMap/StatementTest.php +++ b/tests/unit/Data/SqlMap/StatementTest.php @@ -91,7 +91,7 @@ class StatementTest extends BaseCase function testExecuteQueryForObjectWithSimpleResultClass() { $email = $this->sqlmap->QueryForObject("GetEmailAddressViaResultClass", 1); - $this->assertIdentical("Joe.Dalton@somewhere.com", $email); + $this->assertSame("Joe.Dalton@somewhere.com", $email); } /** @@ -100,7 +100,7 @@ class StatementTest extends BaseCase function testExecuteQueryForObjectWithSimpleResultMap() { $email = $this->sqlmap->QueryForObject("GetEmailAddressViaResultMap", 1); - $this->assertIdentical("Joe.Dalton@somewhere.com", $email); + $this->assertSame("Joe.Dalton@somewhere.com", $email); } /** @@ -110,7 +110,7 @@ class StatementTest extends BaseCase { $CardExpiry = $this->sqlmap->QueryForObject("GetOrderCardExpiryViaResultClass", 1); $date = @mktime(8, 15, 00, 2, 15, 2003); - $this->assertIdentical($date, $CardExpiry->getTimeStamp()); + $this->assertSame($date, $CardExpiry->getTimeStamp()); } /** @@ -153,7 +153,7 @@ class StatementTest extends BaseCase $testItem = $this->sqlmap->QueryForObject("GetSpecificLineItem", $param); $this->assertNotNull($testItem); - $this->assertIdentical("TSM-12", $testItem->getCode()); + $this->assertSame("TSM-12", $testItem->getCode()); } /**/ @@ -162,11 +162,11 @@ class StatementTest extends BaseCase { //$list = $this->sqlmap->QueryForList("GetDynamicOrderedEmailAddressesViaResultMap", "Account_ID"); - //$this->assertIdentical("Joe.Dalton@somewhere.com", $list[0]); + //$this->assertSame("Joe.Dalton@somewhere.com", $list[0]); //list = $this->sqlmap->QueryForList("GetDynamicOrderedEmailAddressesViaResultMap", "Account_FirstName"); - //$this->assertIdentical("Averel.Dalton@somewhere.com", $list[0]); + //$this->assertSame("Averel.Dalton@somewhere.com", $list[0]); } @@ -176,14 +176,14 @@ class StatementTest extends BaseCase //$list = $this->sqlmap->QueryForList("GetAllAccountsViaResultMapWithDynamicElement", "LIKE"); //$this->assertAccount1$list[0]); - //$this->assertIdentical(3, $list->getCount()); - //$this->assertIdentical(1, $list[0]->getID()); - //$this->assertIdentical(2, $list[1]->getID()); - //$this->assertIdentical(4, $list[2]->getID()); + //$this->assertSame(3, $list->getCount()); + //$this->assertSame(1, $list[0]->getID()); + //$this->assertSame(2, $list[1]->getID()); + //$this->assertSame(4, $list[2]->getID()); //list = $this->sqlmap->QueryForList("GetAllAccountsViaResultMapWithDynamicElement", "="); - //$this->assertIdentical(0, $list->getCount()); + //$this->assertSame(0, $list->getCount()); } @@ -208,15 +208,15 @@ class StatementTest extends BaseCase { //$enumClass = $this->sqlmap->QueryForObject("GetEnumeration", 1); - //$this->assertIdentical(enumClass.Day, Days.Sat); - //$this->assertIdentical(enumClass.Color, Colors.Red); - //$this->assertIdentical(enumClass.Month, Months.August); + //$this->assertSame(enumClass.Day, Days.Sat); + //$this->assertSame(enumClass.Color, Colors.Red); + //$this->assertSame(enumClass.Month, Months.August); //enumClass = $this->sqlmap->QueryForObject("GetEnumeration", 3) as Enumeration; - //$this->assertIdentical(enumClass.Day, Days.Mon); - //$this->assertIdentical(enumClass.Color, Colors.Blue); - //$this->assertIdentical(enumClass.Month, Months.September);*/ + //$this->assertSame(enumClass.Day, Days.Mon); + //$this->assertSame(enumClass.Color, Colors.Blue); + //$this->assertSame(enumClass.Month, Months.September);*/ } #endregion @@ -232,13 +232,13 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccountsAsHashMapViaResultMap"); $this->assertAccount1AsHashArray($list[0]); - $this->assertIdentical(5, count($list)); + $this->assertSame(5, count($list)); - $this->assertIdentical(1, (int)$list[0]["Id"]); - $this->assertIdentical(2, (int)$list[1]["Id"]); - $this->assertIdentical(3, (int)$list[2]["Id"]); - $this->assertIdentical(4, (int)$list[3]["Id"]); - $this->assertIdentical(5, (int)$list[4]["Id"]); + $this->assertSame(1, (int)$list[0]["Id"]); + $this->assertSame(2, (int)$list[1]["Id"]); + $this->assertSame(3, (int)$list[2]["Id"]); + $this->assertSame(4, (int)$list[3]["Id"]); + $this->assertSame(5, (int)$list[4]["Id"]); } /** @@ -249,13 +249,13 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccountsAsHashtableViaResultClass"); $this->assertAccount1AsHashArray($list[0]); - $this->assertIdentical(5, count($list)); + $this->assertSame(5, count($list)); - $this->assertIdentical(1, (int)$list[0]["Id"]); - $this->assertIdentical(2, (int)$list[1]["Id"]); - $this->assertIdentical(3, (int)$list[2]["Id"]); - $this->assertIdentical(4, (int)$list[3]["Id"]); - $this->assertIdentical(5, (int)$list[4]["Id"]); + $this->assertSame(1, (int)$list[0]["Id"]); + $this->assertSame(2, (int)$list[1]["Id"]); + $this->assertSame(3, (int)$list[2]["Id"]); + $this->assertSame(4, (int)$list[3]["Id"]); + $this->assertSame(5, (int)$list[4]["Id"]); } /** @@ -267,23 +267,23 @@ class StatementTest extends BaseCase $listAccount = $list[0]; - $this->assertIdentical(1,(int)$listAccount[0]); - $this->assertIdentical("Joe",$listAccount[1]); - $this->assertIdentical("Dalton",$listAccount[2]); - $this->assertIdentical("Joe.Dalton@somewhere.com",$listAccount[3]); + $this->assertSame(1,(int)$listAccount[0]); + $this->assertSame("Joe",$listAccount[1]); + $this->assertSame("Dalton",$listAccount[2]); + $this->assertSame("Joe.Dalton@somewhere.com",$listAccount[3]); - $this->assertIdentical(5, count($list)); + $this->assertSame(5, count($list)); $listAccount = $list[0]; - $this->assertIdentical(1, (int)$listAccount[0]); + $this->assertSame(1, (int)$listAccount[0]); $listAccount = $list[1]; - $this->assertIdentical(2, (int)$listAccount[0]); + $this->assertSame(2, (int)$listAccount[0]); $listAccount = $list[2]; - $this->assertIdentical(3, (int)$listAccount[0]); + $this->assertSame(3, (int)$listAccount[0]); $listAccount = $list[3]; - $this->assertIdentical(4, (int)$listAccount[0]); + $this->assertSame(4, (int)$listAccount[0]); $listAccount = $list[4]; - $this->assertIdentical(5, (int)$listAccount[0]); + $this->assertSame(5, (int)$listAccount[0]); } /** @@ -294,12 +294,12 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccountsViaResultMap"); $this->assertAccount1($list[0]); - $this->assertIdentical(5, count($list)); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); - $this->assertIdentical(3, $list[2]->getID()); - $this->assertIdentical(4, $list[3]->getID()); - $this->assertIdentical(5, $list[4]->getID()); + $this->assertSame(5, count($list)); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); + $this->assertSame(3, $list[2]->getID()); + $this->assertSame(4, $list[3]->getID()); + $this->assertSame(5, $list[4]->getID()); } /** @@ -314,138 +314,138 @@ class StatementTest extends BaseCase $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); $this->assertAccount1($list[0]); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); // Test illegal previous page (no effect, state should be same) $list->PreviousPage(); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); $this->assertAccount1($list[0]); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); // Test next (page 1) $list->NextPage(); $this->assertTrue($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(3, $list[0]->getID()); - $this->assertIdentical(4, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(3, $list[0]->getID()); + $this->assertSame(4, $list[1]->getID()); // Test next (page 2 -last) $list->NextPage(); $this->assertTrue($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(1, $list->getCount()); - $this->assertIdentical(5, $list[0]->getID()); + $this->assertSame(1, $list->getCount()); + $this->assertSame(5, $list[0]->getID()); // Test previous (page 1) $list->PreviousPage(); $this->assertTrue($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(3, $list[0]->getID()); - $this->assertIdentical(4, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(3, $list[0]->getID()); + $this->assertSame(4, $list[1]->getID()); // Test previous (page 0 -first) $list->PreviousPage(); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); $this->assertAccount1($list[0]); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); // Test goto (page 0) $list->GotoPage(0); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); // Test goto (page 1) $list->GotoPage(1); $this->assertTrue($list->getIsPreviousPageAvailable()); $this->assertTrue($list->getIsNextPageAvailable()); - $this->assertIdentical(2, $list->getCount()); - $this->assertIdentical(3, $list[0]->getID()); - $this->assertIdentical(4, $list[1]->getID()); + $this->assertSame(2, $list->getCount()); + $this->assertSame(3, $list[0]->getID()); + $this->assertSame(4, $list[1]->getID()); // Test goto (page 2) $list->GotoPage(2); $this->assertTrue($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(1, $list->getCount()); - $this->assertIdentical(5, $list[0]->getID()); + $this->assertSame(1, $list->getCount()); + $this->assertSame(5, $list[0]->getID()); // Test illegal goto (page 0) $list->GotoPage(3); $this->assertTrue($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(0, $list->getCount()); + $this->assertSame(0, $list->getCount()); $list = $this->sqlmap->QueryForPagedList("GetNoAccountsViaResultMap", null, 2); // Test empty list $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(0, $list->getCount()); + $this->assertSame(0, $list->getCount()); // Test next $list->NextPage(); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(0, $list->getCount()); + $this->assertSame(0, $list->getCount()); // Test previous $list->PreviousPage(); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(0, $list->getCount()); + $this->assertSame(0, $list->getCount()); // Test previous $list->GotoPage(0); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(0, $list->getCount()); + $this->assertSame(0, $list->getCount()); $list = $this->sqlmap->QueryForPagedList("GetFewAccountsViaResultMap", null, 2); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(1, $list->getCount()); + $this->assertSame(1, $list->getCount()); // Test next $list->NextPage(); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(1, $list->getCount()); + $this->assertSame(1, $list->getCount()); // Test previous $list->PreviousPage(); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(1, $list->getCount()); + $this->assertSame(1, $list->getCount()); // Test previous $list->GotoPage(0); $this->assertFalse($list->getIsPreviousPageAvailable()); $this->assertFalse($list->getIsNextPageAvailable()); - $this->assertIdentical(1, $list->getCount()); + $this->assertSame(1, $list->getCount()); $list = $this->sqlmap->QueryForPagedList("GetAllAccountsViaResultMap", null, 5); - $this->assertIdentical(5, $list->getCount()); + $this->assertSame(5, $list->getCount()); $list->NextPage(); - $this->assertIdentical(5, $list->getCount()); + $this->assertSame(5, $list->getCount()); $b = $list->getIsPreviousPageAvailable(); $list->PreviousPage(); - $this->assertIdentical(5, $list->getCount()); + $this->assertSame(5, $list->getCount()); } /** @@ -458,12 +458,12 @@ class StatementTest extends BaseCase $this->sqlmap->QueryForList("GetAllAccountsViaResultMap", null, $accounts); $this->assertAccount1($accounts[0]); - $this->assertIdentical(5, $accounts->getCount()); - $this->assertIdentical(1, $accounts[0]->getID()); - $this->assertIdentical(2, $accounts[1]->getID()); - $this->assertIdentical(3, $accounts[2]->getID()); - $this->assertIdentical(4, $accounts[3]->getID()); - $this->assertIdentical(5, $accounts[4]->GetId()); + $this->assertSame(5, $accounts->getCount()); + $this->assertSame(1, $accounts[0]->getID()); + $this->assertSame(2, $accounts[1]->getID()); + $this->assertSame(3, $accounts[2]->getID()); + $this->assertSame(4, $accounts[3]->getID()); + $this->assertSame(5, $accounts[4]->GetId()); } /** @@ -474,9 +474,9 @@ class StatementTest extends BaseCase $linesItem = $this->sqlmap->QueryForList("GetLineItemsForOrderWithListClass", 10); $this->assertNotNull($linesItem); - $this->assertIdentical(2, $linesItem->getCount()); - $this->assertIdentical("ESM-34", $linesItem[0]->getCode()); - $this->assertIdentical("QSM-98", $linesItem[1]->getCode()); + $this->assertSame(2, $linesItem->getCount()); + $this->assertSame("ESM-34", $linesItem[0]->getCode()); + $this->assertSame("QSM-98", $linesItem[1]->getCode()); } /** @@ -486,7 +486,7 @@ class StatementTest extends BaseCase { $list = $this->sqlmap->QueryForList("GetNoAccountsViaResultMap"); - $this->assertIdentical(0, count($list)); + $this->assertSame(0, count($list)); } /** @@ -497,12 +497,12 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccountsViaResultClass"); $this->assertAccount1($list[0]); - $this->assertIdentical(5, count($list)); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); - $this->assertIdentical(3, $list[2]->getID()); - $this->assertIdentical(4, $list[3]->getID()); - $this->assertIdentical(5, $list[4]->getID()); + $this->assertSame(5, count($list)); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); + $this->assertSame(3, $list[2]->getID()); + $this->assertSame(4, $list[3]->getID()); + $this->assertSame(5, $list[4]->getID()); } /** @@ -512,11 +512,11 @@ class StatementTest extends BaseCase { $list = $this->sqlmap->QueryForList("GetAllEmailAddressesViaResultClass"); - $this->assertIdentical("Joe.Dalton@somewhere.com", $list[0]); - $this->assertIdentical("Averel.Dalton@somewhere.com", $list[1]); - $this->assertIdentical('', $list[2]); - $this->assertIdentical("Jack.Dalton@somewhere.com", $list[3]); - $this->assertIdentical('', $list[4]); + $this->assertSame("Joe.Dalton@somewhere.com", $list[0]); + $this->assertSame("Averel.Dalton@somewhere.com", $list[1]); + $this->assertSame('', $list[2]); + $this->assertSame("Jack.Dalton@somewhere.com", $list[3]); + $this->assertSame('', $list[4]); } /** @@ -526,11 +526,11 @@ class StatementTest extends BaseCase { $list = $this->sqlmap->QueryForList("GetAllEmailAddressesViaResultMap"); - $this->assertIdentical("Joe.Dalton@somewhere.com", $list[0]); - $this->assertIdentical("Averel.Dalton@somewhere.com", $list[1]); - $this->assertIdentical('', $list[2]); - $this->assertIdentical("Jack.Dalton@somewhere.com", $list[3]); - $this->assertIdentical('', $list[4]); + $this->assertSame("Joe.Dalton@somewhere.com", $list[0]); + $this->assertSame("Averel.Dalton@somewhere.com", $list[1]); + $this->assertSame('', $list[2]); + $this->assertSame("Jack.Dalton@somewhere.com", $list[3]); + $this->assertSame('', $list[4]); } /** @@ -540,9 +540,9 @@ class StatementTest extends BaseCase { $list = $this->sqlmap->QueryForList("GetAllAccountsViaResultMap", null, null, 2, 2); - $this->assertIdentical(2, count($list)); - $this->assertIdentical(3, $list[0]->getID()); - $this->assertIdentical(4, $list[1]->getID()); + $this->assertSame(2, count($list)); + $this->assertSame(3, $list[0]->getID()); + $this->assertSame(4, $list[1]->getID()); } @@ -555,14 +555,14 @@ class StatementTest extends BaseCase //$list = $this->sqlmap->QueryWithRowDelegate("GetAllAccountsViaResultMap", null, handler); - //$this->assertIdentical(5, _index); - //$this->assertIdentical(5, $list->getCount()); + //$this->assertSame(5, _index); + //$this->assertSame(5, $list->getCount()); //$this->assertAccount1$list[0]); - //$this->assertIdentical(1, $list[0]->getID()); - //$this->assertIdentical(2, $list[1]->getID()); - //$this->assertIdentical(3, $list[2]->getID()); - //$this->assertIdentical(4, $list[3]->getID()); - //$this->assertIdentical(5, $list[4]->getID()); + //$this->assertSame(1, $list[0]->getID()); + //$this->assertSame(2, $list[1]->getID()); + //$this->assertSame(3, $list[2]->getID()); + //$this->assertSame(4, $list[3]->getID()); + //$this->assertSame(5, $list[4]->getID()); } #endregion @@ -576,14 +576,14 @@ class StatementTest extends BaseCase { $map = $this->sqlmap->QueryForMap("GetAllAccountsViaResultClass", null, "FirstName"); - $this->assertIdentical(5, count($map)); + $this->assertSame(5, count($map)); $this->assertAccount1($map["Joe"]); - $this->assertIdentical(1, $map["Joe"]->getID()); - $this->assertIdentical(2, $map["Averel"]->getID()); - $this->assertIdentical(3, $map["William"]->getID()); - $this->assertIdentical(4, $map["Jack"]->getID()); - $this->assertIdentical(5, $map["Gilles"]->getID()); + $this->assertSame(1, $map["Joe"]->getID()); + $this->assertSame(2, $map["Averel"]->getID()); + $this->assertSame(3, $map["William"]->getID()); + $this->assertSame(4, $map["Jack"]->getID()); + $this->assertSame(5, $map["Gilles"]->getID()); } /** @@ -596,10 +596,10 @@ class StatementTest extends BaseCase { $map = $this->sqlmap->QueryForMap("GetAllOrderWithLineItems", null, "PostalCode"); - $this->assertIdentical(11, count($map)); + $this->assertSame(11, count($map)); $order = $map["T4H 9G4"]; - $this->assertIdentical(2, $order->getLineItemsList()->getCount()); + $this->assertSame(2, $order->getLineItemsList()->getCount()); } /** @@ -611,12 +611,12 @@ class StatementTest extends BaseCase $map = $this->sqlmap->QueryForMap("GetAllAccountsViaResultClass", null, "FirstName", "EmailAddress"); - $this->assertIdentical(5, count($map)); + $this->assertSame(5, count($map)); - $this->assertIdentical("Joe.Dalton@somewhere.com", $map["Joe"]); - $this->assertIdentical("Averel.Dalton@somewhere.com", $map["Averel"]); + $this->assertSame("Joe.Dalton@somewhere.com", $map["Joe"]); + $this->assertSame("Averel.Dalton@somewhere.com", $map["Averel"]); $this->assertNull($map["William"]); - $this->assertIdentical("Jack.Dalton@somewhere.com", $map["Jack"]); + $this->assertSame("Jack.Dalton@somewhere.com", $map["Jack"]); $this->assertNull($map["Gilles"]); } @@ -663,12 +663,12 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccounts"); $this->assertAccount1($list[0]); - $this->assertIdentical(5, count($list)); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); - $this->assertIdentical(3, $list[2]->getID()); - $this->assertIdentical(4, $list[3]->getID()); - $this->assertIdentical(5, $list[4]->getID()); + $this->assertSame(5, count($list)); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); + $this->assertSame(3, $list[2]->getID()); + $this->assertSame(4, $list[3]->getID()); + $this->assertSame(5, $list[4]->getID()); } /** @@ -679,13 +679,13 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccountsOrderByName"); $this->assertAccount1($list[3]); - $this->assertIdentical(5, count($list)); + $this->assertSame(5, count($list)); - $this->assertIdentical(2, $list[0]->getID()); - $this->assertIdentical(5, $list[1]->getID()); - $this->assertIdentical(4, $list[2]->getID()); - $this->assertIdentical(1, $list[3]->getID()); - $this->assertIdentical(3, $list[4]->getID()); + $this->assertSame(2, $list[0]->getID()); + $this->assertSame(5, $list[1]->getID()); + $this->assertSame(4, $list[2]->getID()); + $this->assertSame(1, $list[3]->getID()); + $this->assertSame(3, $list[4]->getID()); } /** @@ -707,11 +707,11 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetSomeAccount", $param); - $this->assertIdentical(3, count($list)); + $this->assertSame(3, count($list)); - $this->assertIdentical(2, $list[0]->getID()); - $this->assertIdentical(3, $list[1]->getID()); - $this->assertIdentical(4, $list[2]->getID()); + $this->assertSame(2, $list[0]->getID()); + $this->assertSame(3, $list[1]->getID()); + $this->assertSame(4, $list[2]->getID()); } #endregion @@ -739,7 +739,7 @@ class StatementTest extends BaseCase $this->assertNotNull($testAccount); - $this->assertIdentical(10, $testAccount->getID()); + $this->assertSame(10, $testAccount->getID()); $this->initScript('account-init.sql'); } @@ -792,7 +792,7 @@ class StatementTest extends BaseCase $testAccount = $this->sqlmap->QueryForObject("GetAccountViaColumnIndex", 10); $this->assertNotNull($testAccount); - $this->assertIdentical(10, $testAccount->getId()); + $this->assertSame(10, $testAccount->getId()); $this->initScript('account-init.sql'); } @@ -824,7 +824,7 @@ class StatementTest extends BaseCase $account = $this->sqlmap->QueryForObject("GetAccountViaColumnName", 1); - $this->assertIdentical("new@somewhere.com", $account->getEmailAddress()); + $this->assertSame("new@somewhere.com", $account->getEmailAddress()); $this->initScript('account-init.sql'); } @@ -841,7 +841,7 @@ class StatementTest extends BaseCase $account = $this->sqlmap->QueryForObject("GetAccountViaColumnName", 1); - $this->assertIdentical("new@somewhere.com", $account->getEmailAddress()); + $this->assertSame("new@somewhere.com", $account->getEmailAddress()); $this->initScript('account-init.sql'); } @@ -858,7 +858,7 @@ class StatementTest extends BaseCase $account = $this->sqlmap->QueryForObject("GetAccountViaColumnName", 1); - $this->assertIdentical("new@somewhere.com", $account->getEmailAddress()); + $this->assertSame("new@somewhere.com", $account->getEmailAddress()); $this->initScript('account-init.sql'); } @@ -879,7 +879,7 @@ class StatementTest extends BaseCase $account = $this->sqlmap->QueryForObject("GetAccountViaColumnName", 6); $this->assertNull($account); - $this->assertIdentical(0, $noRowsDeleted); + $this->assertSame(0, $noRowsDeleted); $this->initScript('account-init.sql'); } @@ -915,7 +915,7 @@ class StatementTest extends BaseCase $this->initScript('line-item-init.sql'); $rowNumber = $this->sqlmap->Delete("DeleteWithComments"); - $this->assertIdentical($rowNumber, 2); + $this->assertSame($rowNumber, 2); $this->initScript('line-item-init.sql'); } @@ -930,7 +930,7 @@ class StatementTest extends BaseCase function RowHandler($sender, $paramterObject, $list) { //_index++; - //$this->assertIdentical(_index, (($account) obj).Id); + //$this->assertSame(_index, (($account) obj).Id); //$list->Add(obj); } @@ -994,7 +994,7 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAccounts"); $this->assertAccount1($list[0]); - $this->assertIdentical(5, count($list)); + $this->assertSame(5, count($list)); } /** @@ -1010,7 +1010,7 @@ class StatementTest extends BaseCase $firstId = HashCodeProvider.GetIdentityHashCode(list); list = $this->sqlmap->QueryForList("GetCachedAccountsViaResultMap"); int secondId = HashCodeProvider.GetIdentityHashCode(list); - $this->assertIdentical(firstId, secondId); + $this->assertSame(firstId, secondId); string cacheStats = $this->sqlmap->GetDataCacheStats(); @@ -1032,12 +1032,12 @@ class StatementTest extends BaseCase $list = $this->sqlmap->QueryForList("GetAllAccountsViaCustomTypeHandler"); $this->assertAccount1($list[0]); - $this->assertIdentical(5, count($list)); - $this->assertIdentical(1, $list[0]->getID()); - $this->assertIdentical(2, $list[1]->getID()); - $this->assertIdentical(3, $list[2]->getID()); - $this->assertIdentical(4, $list[3]->getID()); - $this->assertIdentical(5, $list[4]->getID()); + $this->assertSame(5, count($list)); + $this->assertSame(1, $list[0]->getID()); + $this->assertSame(2, $list[1]->getID()); + $this->assertSame(3, $list[2]->getID()); + $this->assertSame(4, $list[3]->getID()); + $this->assertSame(5, $list[4]->getID()); $this->assertFalse($list[0]->getCartOptions()); $this->assertFalse($list[1]->getCartOptions()); @@ -1071,10 +1071,10 @@ class StatementTest extends BaseCase $anOther = $this->sqlmap->QueryForObject("SelectByInt", 99); $this->assertNotNull( $anOther ); - $this->assertIdentical(99, (int)$anOther->getInt()); - $this->assertIdentical(1966, (int)$anOther->getLong()); - $this->assertIdentical(true, (boolean)$anOther->getBool()); - $this->assertIdentical(false, (boolean)$anOther->getBool2()); + $this->assertSame(99, (int)$anOther->getInt()); + $this->assertSame(1966, (int)$anOther->getLong()); + $this->assertSame(true, (boolean)$anOther->getBool()); + $this->assertSame(false, (boolean)$anOther->getBool2()); } @@ -1097,10 +1097,10 @@ class StatementTest extends BaseCase $anOther = $this->sqlmap->QueryForObject("SelectByIntV1", 99); $this->assertNotNull( $anOther ); - $this->assertIdentical(99, (int)$anOther->getInt()); - $this->assertIdentical(1966, (int)$anOther->getLong()); - $this->assertIdentical(true, (boolean)$anOther->getBool()); - $this->assertIdentical(false, (boolean)$anOther->getBool2()); + $this->assertSame(99, (int)$anOther->getInt()); + $this->assertSame(1966, (int)$anOther->getLong()); + $this->assertSame(true, (boolean)$anOther->getBool()); + $this->assertSame(false, (boolean)$anOther->getBool2()); } @@ -1123,10 +1123,10 @@ class StatementTest extends BaseCase $anOther = $this->sqlmap->QueryForObject("SelectByInt", 99); $this->assertNotNull( $anOther ); - $this->assertIdentical(99, (int)$anOther->getInt()); - $this->assertIdentical(1966, (int)$anOther->getLong()); - $this->assertIdentical(true, (boolean)$anOther->getBool()); - $this->assertIdentical(false, (boolean)$anOther->getBool2()); + $this->assertSame(99, (int)$anOther->getInt()); + $this->assertSame(1966, (int)$anOther->getLong()); + $this->assertSame(true, (boolean)$anOther->getBool()); + $this->assertSame(false, (boolean)$anOther->getBool2()); } #endregion /**/ diff --git a/tests/unit/Data/SqlMap/TestQueryForMap.php b/tests/unit/Data/SqlMap/TestQueryForMap.php index 09810489..f50d0c76 100644 --- a/tests/unit/Data/SqlMap/TestQueryForMap.php +++ b/tests/unit/Data/SqlMap/TestQueryForMap.php @@ -18,11 +18,11 @@ class TestQueryForMap extends BaseCase function testExecuteQueryForMap() { $map = $this->sqlmap->QueryForMap("GetAllAccountsViaResultClass", null, "FirstName",null,0,2); - $this->assertIdentical(2, count($map)); + $this->assertSame(2, count($map)); $this->assertAccount1($map["Joe"]); - $this->assertIdentical(1, $map["Joe"]->getID()); - $this->assertIdentical(2, $map["Averel"]->getID()); + $this->assertSame(1, $map["Joe"]->getID()); + $this->assertSame(2, $map["Averel"]->getID()); } /** @@ -34,11 +34,11 @@ class TestQueryForMap extends BaseCase $map = $this->sqlmap->QueryForMap("GetAllAccountsViaResultClass", null, "FirstName", "EmailAddress",1,3); - $this->assertIdentical(3, count($map)); + $this->assertSame(3, count($map)); - $this->assertIdentical("Averel.Dalton@somewhere.com", $map["Averel"]); + $this->assertSame("Averel.Dalton@somewhere.com", $map["Averel"]); $this->assertNull($map["William"]); - $this->assertIdentical("Jack.Dalton@somewhere.com", $map["Jack"]); + $this->assertSame("Jack.Dalton@somewhere.com", $map["Jack"]); } } diff --git a/tests/unit/Data/SqlMap/Ticket589Test.php b/tests/unit/Data/SqlMap/Ticket589Test.php index a648e74f..c85a4aea 100644 --- a/tests/unit/Data/SqlMap/Ticket589Test.php +++ b/tests/unit/Data/SqlMap/Ticket589Test.php @@ -17,7 +17,7 @@ class Ticket589Test extends PHPUnit_Framework_TestCase }catch(TSqlMapConfigurationException $e) { $expect = 'Invalid property \'parametrClass\' for class \'TSqlMapStatement\' for tag \'<statement id="findNotVisitedWatchedTopicList"'; - $this->assertEqual(strpos($e->getMessage(),$expect),0); + $this->assertEquals(strpos($e->getMessage(),$expect),0); } } } diff --git a/tests/unit/Data/SqlMap/common.php b/tests/unit/Data/SqlMap/common.php index 020a296b..38bcc92f 100644 --- a/tests/unit/Data/SqlMap/common.php +++ b/tests/unit/Data/SqlMap/common.php @@ -92,8 +92,8 @@ class MySQLBaseTestConfig extends BaseTestConfig $this->_sqlmapConfigFile = SQLMAP_TESTS.'/mysql.xml'; $this->_scriptDir = SQLMAP_TESTS.'/scripts/mysql/'; $this->_features = array('insert_id'); - $dsn = 'mysql:host=localhost;dbname=sqlmap_test;port=3307'; - $this->_connection = new TDbConnection($dsn, 'test5', 'test5'); + $dsn = 'mysql:host=localhost;dbname=prado_unitest;port=3306'; + $this->_connection = new TDbConnection($dsn, 'prado_unitest', 'prado_unitest'); } } diff --git a/tests/unit/Data/SqlMap/fixtures/mysql5_reset.sql b/tests/unit/Data/SqlMap/fixtures/mysql5_reset.sql deleted file mode 100644 index 7544ce6b..00000000 --- a/tests/unit/Data/SqlMap/fixtures/mysql5_reset.sql +++ /dev/null @@ -1,22 +0,0 @@ -TRUNCATE TABLE `prado_system_data_sqlmap`.`dynamicparametertest1`;
-TRUNCATE TABLE `prado_system_data_sqlmap`.`dynamicparametertest2`;
-
-INSERT INTO `prado_system_data_sqlmap`.`dynamicparametertest1` (
- `testname` ,
- `teststring` ,
- `testinteger`
-)
-VALUES
-('staticsql', 'staticsql1', '1'),
-('dynamictable', 'dynamictableparametertest1', '1')
-;
-
-INSERT INTO `prado_system_data_sqlmap`.`dynamicparametertest2` (
- `testname` ,
- `teststring` ,
- `testinteger`
-)
-VALUES
-('staticsql', 'staticsql2', '2'),
-('dynamictable', 'dynamictableparametertest2', '2')
-;
diff --git a/tests/unit/Data/SqlMap/fixtures/mysql5_setup.sql b/tests/unit/Data/SqlMap/fixtures/mysql5_setup.sql deleted file mode 100644 index 753b48ac..00000000 --- a/tests/unit/Data/SqlMap/fixtures/mysql5_setup.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE DATABASE `prado_system_data_sqlmap`
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_general_ci;
-
-GRANT ALL ON `prado_system_data_sqlmap`.*
- TO 'prado_unitest'@'localhost'
- IDENTIFIED BY 'prado_system_data_sqlmap_unitest';
-
-DROP TABLE IF EXISTS `dynamicparametertest1`;
-CREATE TABLE `dynamicparametertest1` (
- `testname` varchar(50) NOT NULL,
- `teststring` varchar(50) NOT NULL,
- `testinteger` int(11) NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-DROP TABLE IF EXISTS `dynamicparametertest2`;
-CREATE TABLE `dynamicparametertest2` (
- `testname` varchar(50) NOT NULL,
- `teststring` varchar(50) NOT NULL,
- `testinteger` int(11) NOT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
diff --git a/tests/unit/Data/SqlMap/queryForListLimitTest.php b/tests/unit/Data/SqlMap/queryForListLimitTest.php index 7038dc68..72351c72 100644 --- a/tests/unit/Data/SqlMap/queryForListLimitTest.php +++ b/tests/unit/Data/SqlMap/queryForListLimitTest.php @@ -25,14 +25,14 @@ class queryForListLimitTest extends BaseCase function test_accounts_limit_2() { $list1 = $this->sqlmap->queryForList('GetAllAccountsAsArrayListViaResultClass',null,null,1,2); - $this->assertEqual(count($list1),2); + $this->assertEquals(count($list1),2); - $this->assertEqual($list1[0][0],'2'); - $this->assertEqual($list1[0][1],'Averel'); - $this->assertEqual($list1[0][2],'Dalton'); + $this->assertEquals($list1[0][0],'2'); + $this->assertEquals($list1[0][1],'Averel'); + $this->assertEquals($list1[0][2],'Dalton'); - $this->assertEqual($list1[1][0],'3'); - $this->assertEqual($list1[1][1],'William'); - $this->assertEqual($list1[1][2],'Dalton'); + $this->assertEquals($list1[1][0],'3'); + $this->assertEquals($list1[1][1],'William'); + $this->assertEquals($list1[1][2],'Dalton'); } } |