From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../simple_unit/SqlMap/ActiveRecordSqlMapTest.php | 172 ++++++++++----------- 1 file changed, 86 insertions(+), 86 deletions(-) (limited to 'tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php') diff --git a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php index cc276a25..b3cde511 100644 --- a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php +++ b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php @@ -1,87 +1,87 @@ -initSqlMap(); - TActiveRecordManager::getInstance()->setDbConnection($this->getConnection()); - - //$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()); - - $check1 = $this->sqlmap->queryForObject('GetActiveRecordAccounts'); - $finder = ActiveAccount::finder(); - $check2 = $finder->findByAccount_FirstName($record->Account_FirstName); - - - $this->assertSameAccount($record,$check1); - $this->assertSameAccount($record,$check2); - - $this->initScript('account-init.sql'); - } - - function assertSameAccount($account1,$account2) - { - $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}); - } -} - +initSqlMap(); + TActiveRecordManager::getInstance()->setDbConnection($this->getConnection()); + + //$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()); + + $check1 = $this->sqlmap->queryForObject('GetActiveRecordAccounts'); + $finder = ActiveAccount::finder(); + $check2 = $finder->findByAccount_FirstName($record->Account_FirstName); + + + $this->assertSameAccount($record,$check1); + $this->assertSameAccount($record,$check2); + + $this->initScript('account-init.sql'); + } + + function assertSameAccount($account1,$account2) + { + $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}); + } +} + ?> \ No newline at end of file -- cgit v1.2.3