コード例 #1
0
ファイル: PageTest.php プロジェクト: gobjila/BackBee
 /**
  * @covers BackBee\NestedNode\Page::setSite
  */
 public function testSetSite()
 {
     $site = new Site();
     $this->assertEquals($this->page, $this->page->setSite($site));
     $this->assertEquals($site, $this->page->getSite());
     $this->page->setSite();
     $this->assertNull($this->page->getSite());
 }
コード例 #2
0
 /**
  * Remove stored site-content indexes from a site and a page.
  *
  * @param Page $page
  *
  * @return IndexationRepository
  */
 private function removeIdxSite(Page $page)
 {
     $query = 'DELETE FROM idx_site_content WHERE site_uid = :site AND content_uid IN (SELECT content_uid FROM idx_page_content WHERE page_uid = :page)';
     $params = array('page' => $page->getUid(), 'site' => $page->getSite()->getUid());
     return $this->_executeQuery($query, $params);
 }
コード例 #3
0
 /**
  * @covers \BackBee\NestedNode\Repository\PageRepository::getRoot
  */
 public function testGetRoot()
 {
     $this->assertEquals($this->root, $this->repository->getRoot($this->root->getSite()));
     $this->assertEquals($this->root, $this->repository->getRoot($this->root->getSite(), array(Page::STATE_HIDDEN)));
     $this->assertNull($this->repository->getRoot($this->root->getSite(), array(Page::STATE_ONLINE)));
 }