예제 #1
0
 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;
 }
예제 #2
0
 public function testConstruct()
 {
     $house = new House(2, 'house name');
     $this->assertEquals(2, $house->getId());
     $this->assertEquals('house name', $house->getName());
 }