Doctrine\Tests\ODM\PHPCR\Functional\ReferenceTest::testUpdate PHP Method

testUpdate() public method

public testUpdate ( )
    public function testUpdate()
    {
        $refTestObj = new RefTestObj();
        $refRefTestObj = new RefRefTestObj();
        $refTestObj->id = "/functional/refTestObj";
        $refRefTestObj->id = "/functional/refRefTestObj";
        $refRefTestObj->name = "referenced";
        $refTestObj->reference = $refRefTestObj;
        $this->dm->persist($refTestObj);
        $this->dm->flush();
        $this->dm->clear();
        $referrer = $this->dm->find($this->referrerType, '/functional/refTestObj');
        $referrer->reference->setName('referenced changed');
        $this->dm->persist($referrer);
        $this->dm->flush();
        $this->dm->clear();
        $node = $this->session->getNode('/functional/refTestObj')->getPropertyValue('myReference');
        $this->assertInstanceOf('PHPCR\\NodeInterface', $node);
        $this->assertEquals('referenced changed', $node->getPropertyValue('name'));
    }