initSqlMap(); TActiveRecordManager::getInstance()->setDbConnection($this->getConnection()); //$this->initScript('account-init.sql'); } function testLoadWithSqlMap_SaveWithActiveRecord() { $record = $this->sqlmap->queryForObject('GetActiveRecordAccounts'); $record->Account_FirstName = "Testing 123"; $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->assertEquals($account1->{$prop}, $account2->{$prop}); } }