public function testUpdatesReservationAttributeIfTheUserCanEdit() { $referenceNumber = 'rn'; $id = 111; $value = 'new attribute value'; $user = $this->fakeUser; $resultCollector = new ManageReservationsUpdateAttributeResultCollector(); $reservation = new ExistingReservationSeries(); $reservation->UpdateBookedBy($user); $reservation->AddAttributeValue(new AttributeValue($id, $value)); $this->persistenceService->expects($this->once())->method('LoadByReferenceNumber')->with($this->equalTo($referenceNumber))->will($this->returnValue($reservation)); $this->reservationHandler->expects($this->once())->method('Handle')->with($this->equalTo($reservation), $this->equalTo($resultCollector)); $result = $this->service->UpdateAttribute($referenceNumber, $id, $value, $user); }