Doctrine\Tests\ODM\CouchDB\Functional\CollectionTest::testReplaceArrayWithPersistentCollections PHP Method

testReplaceArrayWithPersistentCollections() public method

    public function testReplaceArrayWithPersistentCollections()
    {
        $user1 = new \Doctrine\Tests\Models\CMS\CmsUser();
        $user1->username = "beberlei";
        $user1->status = "active";
        $user1->name = "Benjamin";
        $group1 = new \Doctrine\Tests\Models\CMS\CmsGroup();
        $group1->name = "Admin";
        $user1->addGroup($group1);
        $this->dm->persist($user1);
        $this->dm->persist($group1);
        $this->dm->flush();
        $this->assertInstanceOf('Doctrine\\ODM\\CouchDB\\PersistentIdsCollection', $user1->groups);
        $this->assertInstanceOf('Doctrine\\ODM\\CouchDB\\PersistentViewCollection', $group1->users);
    }