Created
January 6, 2014 17:32
-
-
Save anyt/8286331 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ManyToManyTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testSynchronization() | |
{ | |
$post = new Post(); | |
$tag = new Tag(); | |
$post->addTag($tag); | |
// $tag not contains the $post | |
$this->assertFalse($tag->getPosts()->contains($post)); | |
$tag->addPost($post); | |
// now $tag contains the $post | |
$this->assertTrue($tag->getPosts()->contains($post)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment