From a3388622287e218beddfa14a47ed677d4307b36b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 25 Mar 2016 17:55:51 +0100 Subject: Removed simpletest and moved all tests in the unit tree Tests are executed now, but a lot of them need fixing. --- .../simple_unit/SqlMap/ActiveRecordSqlMapTest.php | 85 ---------------------- 1 file changed, 85 deletions(-) delete mode 100644 tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php (limited to 'tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php') diff --git a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php b/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php deleted file mode 100644 index 2ae051e8..00000000 --- a/tests/simple_unit/SqlMap/ActiveRecordSqlMapTest.php +++ /dev/null @@ -1,85 +0,0 @@ -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}); - } -} -- cgit v1.2.3