Пример #1
0
 public function testConstruct()
 {
     $room = new Room(1, 2, 'name');
     $this->assertEquals(1, $room->getId());
     $this->assertEquals(2, $room->getHouseId());
     $this->assertEquals('name', $room->getName());
 }
Пример #2
0
 public function testBookRoom()
 {
     $startDate = (new DateTime())->add(new DateInterval('P1D'));
     $endDate = (new DateTime())->add(new DateInterval('P1M'));
     $booking = new Booking(null, $this->testTenant, $this->testRoom, $startDate, $endDate);
     $this->getBookingRepositoryMock()->expects($this->once())->method('save')->with($booking)->will($this->returnValue($booking));
     $bookResult = $this->bookingHandler->bookRoom($this->testTenant->getId(), $this->testRoom->getId(), $startDate, $endDate);
     $this->assertEquals($booking, $bookResult);
 }