コード例 #1
0
 public function testUpdatesReservationAttribute()
 {
     $referenceNumber = 'rn';
     $attrId = 'attid';
     $attrValue = 'val';
     $this->page->expects($this->once())->method('GetReferenceNumber')->will($this->returnValue($referenceNumber));
     $this->page->expects($this->once())->method('GetAttributeId')->will($this->returnValue($attrId));
     $this->page->expects($this->once())->method('GetAttributeValue')->will($this->returnValue($attrValue));
     $this->reservationsService->expects($this->once())->method('UpdateAttribute')->with($this->equalTo($referenceNumber), $this->equalTo($attrId), $this->equalTo($attrValue), $this->equalTo($this->fakeUser))->will($this->returnValue(array()));
     $this->presenter->UpdateAttribute();
 }
コード例 #2
0
 public function UpdateAttribute()
 {
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $referenceNumber = $this->page->GetReferenceNumber();
     $attributeId = $this->page->GetAttributeId();
     $attributeValue = $this->page->GetAttributeValue();
     Log::Debug('Updating reservation attribute. UserId=%s, AttributeId=%s, AttributeValue=%s, ReferenceNumber=%s', $userSession->UserId, $attributeId, $attributeValue, $referenceNumber);
     $errors = $this->manageReservationsService->UpdateAttribute($referenceNumber, $attributeId, $attributeValue, $userSession);
     if (!empty($errors)) {
         $this->page->BindAttributeUpdateErrors($errors);
     }
 }