public function testReservationRoomExample() { $reservationRepo = new ReservationRepository(new ReservationStore()); $start_date = '2015-10-01'; $end_date = '2015-10-10'; $user_id = App\User::first()->id; $rooms = Room::take(2)->lists('id')->toArray(); $reservation = $reservationRepo->create(['date_start' => $start_date, 'date_end' => $end_date, 'rooms' => $rooms, 'reservation_number' => '0001', 'user_id' => $user_id]); $this->assertInstanceOf('App\\Reservation', $reservation); $this->assertEquals('2015-10-01', $reservation->date_start); $this->assertEquals(2, count($reservation->rooms)); }