public function testService() { $category = $this->getMock('JLM\\ProductBundle\\Model\\ProductCategoryInterface'); $category->expects($this->once())->method('isService')->will($this->returnValue(true)); $this->entity->setCategory($category); $this->assertSame(true, $this->entity->isService()); }