コード例 #1
0
ファイル: BasicCrudTest.php プロジェクト: nicam/phpcr-odm
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testDetachWithMove()
 {
     $user = $this->dm->find($this->type, '/functional/user');
     $user->username = "******";
     $this->dm->detach($user);
     $this->dm->move($user, '/functional/user2');
 }
コード例 #2
0
ファイル: MoveTest.php プロジェクト: richardmiller/phpcr-odm
 public function testRemoveThenMove()
 {
     $this->dm->clear();
     $user = $this->dm->find($this->type, '/functional/lsmith');
     $this->assertNotNull($user, 'User must exist');
     $this->dm->remove($user);
     $this->dm->move($user, '/functional/user2');
     $this->dm->flush();
     $user = $this->dm->find($this->type, '/functional/user2');
     $this->assertNotNull($user, 'User must exist');
     $user = $this->dm->find($this->type, '/functional/lsmith');
     $this->assertNull($user, 'User must be null after deletion');
 }