Fixes #175
This commit is contained in:
parent
c1280d31dc
commit
ec8f446fad
@ -500,9 +500,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
||||
if(isset($this->reference_field))
|
||||
$record->set($this->reference_field, $this->reference, false);
|
||||
|
||||
if(in_array($record,$this->data)) {
|
||||
if(array_search($record, $this->data) !== false)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(isset($key)) {
|
||||
if(isset($this->data[$key]))
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class Doctrine_Collection_OffsetTestCase extends Doctrine_UnitTestCase {
|
||||
class Doctrine_Collection_Offset_TestCase extends Doctrine_UnitTestCase {
|
||||
public function testExpand() {
|
||||
|
||||
$users = $this->connection->query("FROM User-o");
|
||||
|
@ -986,15 +986,10 @@ class Doctrine_Query_TestCase extends Doctrine_UnitTestCase {
|
||||
$this->assertTrue($query instanceof Doctrine_Query);
|
||||
$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');
|
||||
|
||||
$this->assertFalse(strpos($query->getQuery(),"OFFSET"));
|
||||
|
||||
$this->assertFalse(strpos($query->getQuery(),"LIMIT"));
|
||||
|
||||
$coll = $query->execute();
|
||||
|
@ -39,6 +39,7 @@ require_once("QueryComponentAliasTestCase.php");
|
||||
require_once("QuerySubqueryTestCase.php");
|
||||
require_once("QuerySelectTestCase.php");
|
||||
require_once("QueryDeleteTestCase.php");
|
||||
require_once("QueryUpdateTestCase.php");
|
||||
|
||||
require_once("DBTestCase.php");
|
||||
require_once("SchemaTestCase.php");
|
||||
@ -81,7 +82,7 @@ $test->addTestCase(new Doctrine_BatchIteratorTestCase());
|
||||
|
||||
$test->addTestCase(new Doctrine_ConfigurableTestCase());
|
||||
|
||||
$test->addTestCase(new Doctrine_Collection_OffsetTestCase());
|
||||
//$test->addTestCase(new Doctrine_Collection_Offset_TestCase());
|
||||
|
||||
$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_Update_TestCase());
|
||||
|
||||
|
||||
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
|
||||
//$test->addTestCase(new Doctrine_Cache_SqliteTestCase());
|
||||
|
Loading…
Reference in New Issue
Block a user