private function getHouseRepositoryMock() { if (!$this->houseRepositoryMock instanceof PHPUnit_Framework_MockObject_MockObject) { $this->houseRepositoryMock = $this->getMock('\\Vmikki\\Booking\\Repositories\\HouseRepositoryInterface'); $this->houseRepositoryMock->expects($this->any())->method('getById')->will($this->returnCallback(function ($param) { return $param == $this->testHouse->getId() ? $this->testHouse : null; })); } return $this->houseRepositoryMock; }
public function testConstruct() { $house = new House(2, 'house name'); $this->assertEquals(2, $house->getId()); $this->assertEquals('house name', $house->getName()); }