This commit is contained in:
parent
1c81cb3025
commit
54801dded5
@ -1111,11 +1111,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
||||
*/
|
||||
public function __call($m,$a) {
|
||||
if( ! function_exists($m))
|
||||
throw new Doctrine_Record_Exception("unknown callback");
|
||||
throw new Doctrine_Record_Exception("unknown callback '$m'");
|
||||
|
||||
if(isset($a[0])) {
|
||||
$column = $a[0];
|
||||
$this->data[$column] = $m($this->get($column));
|
||||
$a[0] = $this->get($column);
|
||||
$this->data[$column] = call_user_func_array($m, $a);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -7,6 +7,23 @@ class Doctrine_QueryTestCase extends Doctrine_UnitTestCase {
|
||||
$this->tables[] = "Forum_Thread";
|
||||
parent::prepareTables();
|
||||
}
|
||||
public function testImmediateFetching() {
|
||||
$count = $this->dbh->count();
|
||||
$this->session->getTable('User')->clear();
|
||||
$this->session->getTable('Email')->clear();
|
||||
$this->session->getTable('Phonenumber')->clear();
|
||||
|
||||
$users = $this->query->from("User-i.Email-i")->execute();
|
||||
$this->assertEqual(($count + 1),$this->dbh->count());
|
||||
$this->assertEqual(count($users), 8);
|
||||
|
||||
$this->assertEqual(get_class($users[0]->Email), 'Email');
|
||||
$this->assertEqual(($count + 1),$this->dbh->count());
|
||||
|
||||
$this->assertEqual($users[0]->Email->address, 'zYne@example.com');
|
||||
$this->assertEqual(($count + 1),$this->dbh->count());
|
||||
}
|
||||
|
||||
public function testLazyPropertyFetchingWithMultipleColumns() {
|
||||
|
||||
$q = new Doctrine_Query($this->session);
|
||||
@ -52,7 +69,6 @@ class Doctrine_QueryTestCase extends Doctrine_UnitTestCase {
|
||||
$this->assertEqual($count, count($this->dbh));
|
||||
$this->assertTrue(is_numeric($users[2]->email_id));
|
||||
$this->assertEqual($count, count($this->dbh));
|
||||
|
||||
}
|
||||
|
||||
public function testMultipleFetching() {
|
||||
|
@ -7,6 +7,8 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
|
||||
$user->name = " zYne ";
|
||||
$user->trim('name');
|
||||
$this->assertEqual($user->name, 'zYne');
|
||||
$user->substr('name',0,1);
|
||||
$this->assertEqual($user->name, 'z');
|
||||
}
|
||||
public function testJoinTableSelfReferencing() {
|
||||
$e = new Entity();
|
||||
|
@ -25,7 +25,7 @@ $test = new GroupTest("Doctrine Framework Unit Tests");
|
||||
//$test->addTestCase(new Sensei_UnitTestCase());
|
||||
|
||||
$test->addTestCase(new Doctrine_RecordTestCase());
|
||||
/**
|
||||
|
||||
$test->addTestCase(new Doctrine_SessionTestCase());
|
||||
|
||||
$test->addTestCase(new Doctrine_TableTestCase());
|
||||
@ -47,7 +47,7 @@ $test->addTestCase(new Doctrine_Collection_OffsetTestCase());
|
||||
$test->addTestCase(new Doctrine_CollectionTestCase());
|
||||
|
||||
$test->addTestCase(new Doctrine_QueryTestCase());
|
||||
*/
|
||||
|
||||
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
|
||||
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user