Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add tests to versionnable behavior whit foreign key

  • Loading branch information...
commit 47e9a2c332d32d734f2b5073b935362df6193866 1 parent a54ac77
@themouette authored
View
24 ...testsuite/generator/behavior/versionable/VersionableBehaviorObjectBuilderModifierTest.php
@@ -456,6 +456,30 @@ public function testIsVersioningNecessary()
$o->save();
$this->assertFalse($o->isVersioningNecessary());
VersionableBehaviorTest1Peer::enableVersioning();
+
+ $b1 = new VersionableBehaviorTest5();
+ $b1->setFoo('Hello');
+ $b2 = new VersionableBehaviorTest5();
+ $b2->setFoo('World');
+ $a = new VersionableBehaviorTest4();
+ $a->setBar(123); // a1
+ $this->assertTrue($a->isVersioningNecessary());
+ $a->save();
+ $this->assertFalse($a->isVersioningNecessary());
+ $a->addVersionableBehaviorTest5($b1);
+ $this->assertTrue($a->isVersioningNecessary());
+ $a->save();
+ $this->assertFalse($a->isVersioningNecessary());
+ $a->addVersionableBehaviorTest5($b2);
+ $this->assertTrue($a->isVersioningNecessary());
+ $a->save();
+ $this->assertFalse($a->isVersioningNecessary());
+ $b2->setFoo('World !');
+ $this->assertTrue($b2->isVersioningNecessary());
+ $this->assertTrue($a->isVersioningNecessary());
+ $a->save();
+ $this->assertFalse($b2->isVersioningNecessary());
+ $this->assertFalse($a->isVersioningNecessary());
}
public function testAddVersionNewObject()
Please sign in to comment.
Something went wrong with that request. Please try again.