loadByParent() public method

public loadByParent ( $uuid, $webspaceKey, $languageCode, $depth = 1, $flat = true, $ignoreExceptions = false, $excludeGhosts = false )
コード例 #1
0
ファイル: ContentMapperTest.php プロジェクト: Silwereth/sulu
 /**
  * It should delete a node which has children with history.
  * It should not throw an exception.
  */
 public function testDeleteWithChildrenHistory()
 {
     $data = [['title' => 'A', 'url' => '/a'], ['title' => 'B', 'url' => '/a/b'], ['title' => 'C', 'url' => '/a/b/c'], ['title' => 'D', 'url' => '/a/d']];
     // save content
     $data[0] = $this->mapper->save($data[0], 'overview', 'sulu_io', 'de', 1);
     $data[1] = $this->mapper->save($data[1], 'overview', 'sulu_io', 'de', 1, true, null, $data[0]->getUuid());
     $data[2] = $this->mapper->save($data[2], 'overview', 'sulu_io', 'de', 1, true, null, $data[1]->getUuid());
     $data[3] = $this->mapper->save($data[3], 'overview', 'sulu_io', 'de', 1, true, null, $data[0]->getUuid());
     // move /a/b to /a/d/b
     $this->mapper->move($data[1]->getUuid(), $data[3]->getUuid(), 1, 'sulu_io', 'de');
     // delete /a/d
     $this->mapper->delete($data[3]->getUuid(), 'sulu_io');
     // check
     try {
         $this->mapper->load($data[3]->getUuid(), 'sulu_io', 'de');
         $this->fail('Node should not exist');
     } catch (DocumentNotFoundException $ex) {
     }
     $result = $this->mapper->loadByParent($data[0]->getUuid(), 'sulu_io', 'de');
     $this->assertEquals(0, count($result));
 }