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