Skip to content

Commit

Permalink
Collapse cascade persist, remove, refresh, detach, merge into
Browse files Browse the repository at this point in the history
cascade-all (implemented currently only for XML annotation)
  • Loading branch information
goetas committed Oct 24, 2011
1 parent 1b83fcc commit cb76222
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Expand Up @@ -324,7 +324,23 @@ public function testInversedByIsExported($class)
{
$this->assertEquals('user', $class->associationMappings['address']['inversedBy']);
}

/**
* @depends testOneToManyAssociationsAreExported
* @param ClassMetadataInfo $class
*/
public function testCascadeIsDetected($class)
{
if(!isset($class->associationMappings['interests'])){
$this->markTestSkipped('The "interests" association is not aviable.');
}else{
$this->assertTrue($class->associationMappings['interests']['isCascadePersist']);
$this->assertTrue($class->associationMappings['interests']['isCascadeMerge']);
$this->assertTrue($class->associationMappings['interests']['isCascadeRemove']);
$this->assertTrue($class->associationMappings['interests']['isCascadeRefresh']);
$this->assertTrue($class->associationMappings['interests']['isCascadeDetach']);
}
return $class;
}
public function __destruct()
{
# $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType());
Expand Down
Expand Up @@ -35,6 +35,16 @@
</order-by>
</one-to-many>

<one-to-many field="interests" target-entity="Doctrine\Tests\ORM\Tools\Export\Interests" mapped-by="user" orphan-removal="true">
<cascade>
<cascade-refresh/>
<cascade-persist/>
<cascade-merge/>
<cascade-detach/>
<cascade-remove/>
</cascade>
</one-to-many>

<many-to-many field="groups" target-entity="Doctrine\Tests\ORM\Tools\Export\Group">
<cascade>
<cascade-all/>
Expand Down

0 comments on commit cb76222

Please sign in to comment.