示例#1
0
 public function testSetterGetter()
 {
     $time = new \DateTime();
     $page = $this->getMock('Sonata\\PageBundle\\Model\\PageInterface');
     $parent = $this->getMock('Sonata\\PageBundle\\Model\\BlockInterface');
     $block = new Block();
     $block->setCreatedAt($time);
     $block->setUpdatedAt($time);
     $block->setEnabled(true);
     $block->setPosition(1);
     $block->setType('foo.bar');
     $block->setPage($page);
     $block->setParent($parent);
     $this->assertEquals($time, $block->getCreatedAt());
     $this->assertEquals($time, $block->getUpdatedAt());
     $this->assertTrue($block->getEnabled());
     $this->assertEquals(1, $block->getPosition());
     $this->assertEquals('foo.bar', $block->getType());
     $this->assertEquals($page, $block->getPage());
     $this->assertEquals($parent, $block->getParent());
 }