Example #1
0
 /**
  * @covers BackBee\NestedNode\Page::setMainSection()
  */
 public function testSetMainSection()
 {
     $section = new Section('new_section');
     $section->setLevel(10);
     $this->page->setMainSection($section);
     $this->assertEquals($section, $this->page->getMainSection());
     $this->assertEquals($section, $this->page->getSection());
     $this->assertEquals(0, $this->page->getPosition());
     $this->assertEquals(10, $this->page->getLevel());
     $this->assertEquals($this->page, $section->getPage());
 }
Example #2
0
 /**
  * Sets the associated page for this section.
  *
  * @param  Page                 $page
  *
  * @return Section
  */
 public function setPage(Page $page)
 {
     $this->_page = $page;
     $page->setMainSection($this);
     return $this;
 }