Collapse cascade persist, remove, refresh, detach, merge into
cascade-all (implemented currently only for XML annotation)
This commit is contained in:
parent
1b83fcc46d
commit
cb76222e63
@ -324,7 +324,23 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
|
||||
{
|
||||
$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());
|
||||
|
@ -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/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user