| | 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 | } |