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);
 }
Beispiel #2
0
 public function testConstruct()
 {
     $tenant = new Tenant(3, 'tenant name');
     $this->assertEquals(3, $tenant->getId());
     $this->assertEquals('tenant name', $tenant->getName());
 }