1
0
mirror of synced 2024-12-13 14:56:01 +03:00
This commit is contained in:
zYne 2006-10-18 20:17:49 +00:00
parent c1280d31dc
commit ec8f446fad
4 changed files with 8 additions and 11 deletions

View File

@ -500,9 +500,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
if(isset($this->reference_field)) if(isset($this->reference_field))
$record->set($this->reference_field, $this->reference, false); $record->set($this->reference_field, $this->reference, false);
if(in_array($record,$this->data)) { if(array_search($record, $this->data) !== false)
return false; return false;
}
if(isset($key)) { if(isset($key)) {
if(isset($this->data[$key])) if(isset($this->data[$key]))

View File

@ -1,5 +1,5 @@
<?php <?php
class Doctrine_Collection_OffsetTestCase extends Doctrine_UnitTestCase { class Doctrine_Collection_Offset_TestCase extends Doctrine_UnitTestCase {
public function testExpand() { public function testExpand() {
$users = $this->connection->query("FROM User-o"); $users = $this->connection->query("FROM User-o");

View File

@ -986,15 +986,10 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase {
$this->assertTrue($query instanceof Doctrine_Query); $this->assertTrue($query instanceof Doctrine_Query);
$this->assertEqual($query->get("offset"), 5); $this->assertEqual($query->get("offset"), 5);
$query->offset = 7;
$this->assertEqual($query->get("offset"), 7);
$query->limit = 10;
$this->assertEqual($query->limit, 10);
$this->assertTrue(strpos($query->getQuery(),"LIMIT"));
$query->remove('limit')->remove('offset'); $query->remove('limit')->remove('offset');
$this->assertFalse(strpos($query->getQuery(),"OFFSET"));
$this->assertFalse(strpos($query->getQuery(),"LIMIT")); $this->assertFalse(strpos($query->getQuery(),"LIMIT"));
$coll = $query->execute(); $coll = $query->execute();

View File

@ -39,6 +39,7 @@ require_once("QueryComponentAliasTestCase.php");
require_once("QuerySubqueryTestCase.php"); require_once("QuerySubqueryTestCase.php");
require_once("QuerySelectTestCase.php"); require_once("QuerySelectTestCase.php");
require_once("QueryDeleteTestCase.php"); require_once("QueryDeleteTestCase.php");
require_once("QueryUpdateTestCase.php");
require_once("DBTestCase.php"); require_once("DBTestCase.php");
require_once("SchemaTestCase.php"); require_once("SchemaTestCase.php");
@ -81,7 +82,7 @@ $test->addTestCase(new Doctrine_BatchIteratorTestCase());
$test->addTestCase(new Doctrine_ConfigurableTestCase()); $test->addTestCase(new Doctrine_ConfigurableTestCase());
$test->addTestCase(new Doctrine_Collection_OffsetTestCase()); //$test->addTestCase(new Doctrine_Collection_Offset_TestCase());
$test->addTestCase(new Doctrine_PessimisticLockingTestCase()); $test->addTestCase(new Doctrine_PessimisticLockingTestCase());
@ -135,6 +136,8 @@ $test->addTestCase(new Doctrine_Query_Select_TestCase());
$test->addTestCase(new Doctrine_Query_Delete_TestCase()); $test->addTestCase(new Doctrine_Query_Delete_TestCase());
$test->addTestCase(new Doctrine_Query_Update_TestCase());
//$test->addTestCase(new Doctrine_Cache_FileTestCase()); //$test->addTestCase(new Doctrine_Cache_FileTestCase());
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase()); //$test->addTestCase(new Doctrine_Cache_SqliteTestCase());