Example #1
0
 public function testPageTtl()
 {
     $page = new Page();
     $block1 = $this->getMock('Sonata\\PageBundle\\Model\\BlockInterface');
     $block1->expects($this->once())->method('getTtl')->will($this->returnValue(100));
     $block2 = $this->getMock('Sonata\\PageBundle\\Model\\BlockInterface');
     $block2->expects($this->once())->method('getTtl')->will($this->returnValue(50));
     $block3 = $this->getMock('Sonata\\PageBundle\\Model\\BlockInterface');
     $block3->expects($this->once())->method('getTtl')->will($this->returnValue(65));
     $page->addBlocks($block1);
     $page->addBlocks($block2);
     $page->addBlocks($block3);
     $this->assertEquals(50, $page->getTtl());
 }