/** * Test get/set item. */ public function testItem() { $type = new Type(); $this->assertNull($type->getItem()); /* @var $item \PHPUnit_Framework_MockObject_MockObject|Item */ $item = $this->getMock('\\AnimeDb\\Bundle\\CatalogBundle\\Entity\\Widget\\Item'); $item->expects($this->once())->method('setType')->with($type)->will($this->returnSelf()); $this->assertEquals($type, $type->setItem($item)); $this->assertEquals($type, $type->setItem($item)); $this->assertEquals($item, $type->getItem()); }