Changeset 4341
- Timestamp:
- 05/07/08 11:44:29 (8 months ago)
- Location:
- branches/0.11
- Files:
-
- 7 modified
-
lib/Doctrine/Connection/UnitOfWork.php (modified) (1 diff)
-
lib/Doctrine/Hydrator/RecordDriver.php (modified) (1 diff)
-
tests/CustomResultSetOrderTestCase.php (modified) (1 diff)
-
tests/Query/ReferenceModelTestCase.php (modified) (1 diff)
-
tests/RecordTestCase.php (modified) (3 diffs)
-
tests/Relation/AccessTestCase.php (modified) (3 diffs)
-
tests/ValidatorTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Connection/UnitOfWork.php
r4296 r4341 476 476 foreach ($tree as $name) { 477 477 $table = $this->conn->getTable($name); 478 479 478 foreach ($table->getRepository() as $record) { 480 $this->save($record); 481 } 482 } 483 484 // save all associations 485 foreach ($tree as $name) { 486 $table = $this->conn->getTable($name); 487 488 foreach ($table->getRepository() as $record) { 489 $this->saveAssociations($record); 479 $this->saveGraph($record); 490 480 } 491 481 } -
branches/0.11/lib/Doctrine/Hydrator/RecordDriver.php
r4337 r4341 70 70 $this->_collections[] = $coll; 71 71 } 72 73 /**74 * isIdentifiable75 * returns whether or not a given data row is identifiable (it contains76 * all primary key fields specified in the second argument)77 *78 * @param array $row79 * @param Doctrine_Table $table80 * @return boolean81 */82 /*public function isIdentifiable(array $row, Doctrine_Table $table)83 {84 $primaryKeys = $table->getIdentifierColumnNames();85 86 if (is_array($primaryKeys)) {87 foreach ($primaryKeys as $id) {88 if ( ! isset($row[$id])) {89 return false;90 }91 }92 } else {93 if ( ! isset($row[$primaryKeys])) {94 return false;95 }96 }97 return true;98 }*/99 72 100 73 public function getNullPointer() -
branches/0.11/tests/CustomResultSetOrderTestCase.php
r3884 r4341 42 42 */ 43 43 public function prepareData() { 44 $this->connection->clear(); 44 45 $cat1 = new CategoryWithPosition(); 45 46 $cat1->position = 0; -
branches/0.11/tests/Query/ReferenceModelTestCase.php
r3884 r4341 46 46 47 47 public function testInitializeData() { 48 $this->connection->clear(); 48 49 $query = new Doctrine_Query($this->connection); 49 50 -
branches/0.11/tests/RecordTestCase.php
r4294 r4341 47 47 public function testOne2OneForeign() 48 48 { 49 $this->conn->clear(); 49 50 $user = new User(); 50 51 $user->name = "Richard Linklater"; … … 336 337 public function testManyToManyTreeStructure() 337 338 { 338 339 $this->conn->clear(); 339 340 $task = $this->connection->create("Task"); 340 341 … … 413 414 public function testTreeStructure() 414 415 { 416 $this->conn->clear(); 415 417 $e = new Element(); 416 418 -
branches/0.11/tests/Relation/AccessTestCase.php
r4029 r4341 2 2 class Doctrine_Relation_Access_TestCase extends Doctrine_UnitTestCase { 3 3 public function prepareData() { 4 $this->conn->clear(); 4 5 $o1 = new File_Owner(); 5 6 $o1->name = "owner1"; … … 107 108 108 109 $this->assertTrue(isset($owner1->Data_File)); 109 $this->assertFalse(isset($owner2->Data_File)); 110 $this->assertEqual(1, $check->get('id')); 111 $this->assertEqual(1, $owner1->get('id')); 110 $this->assertFalse(isset($owner2->Data_File));; 111 $this->assertIdentical($check, $owner1); 112 112 $this->assertEqual($owner1->get('id'), $check->get('id')); 113 $this->assertEqual(2, $owner2->get('id'));114 115 113 } 116 114 … … 134 132 $this->assertTrue(isset($file1->File_Owner)); 135 133 $this->assertFalse(isset($file2->File_Owner)); 136 $this->assertEqual(4, $check->get('id')); 137 $this->assertEqual(4, $file1->get('id')); 134 $this->assertIdentical($check, $file1); 138 135 $this->assertEqual($file1->get('id'), $check->get('id')); 139 $this->assertEqual(1, $file2->get('id'));140 141 136 } 142 137 -
branches/0.11/tests/ValidatorTestCase.php
r4240 r4341 477 477 $this->manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_NONE); 478 478 } 479 480 public function testValidationIsTriggeredOnFlush() 481 { 482 $this->manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL); 483 $this->conn->clear(); 484 485 $r = new ValidatorTest_Person(); 486 $r->identifier = '5678'; 487 $r->save(); 488 489 $r = new ValidatorTest_Person(); 490 $r->identifier = 5678; 491 try { 492 $this->conn->flush(); 493 $this->fail("No validator exception thrown on unique validation, triggered by flush()."); 494 } catch (Doctrine_Validator_Exception $e) { 495 $this->pass(); 496 } 497 498 $this->manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_NONE); 499 } 479 500 }