public function testWhenAllAttributesAreValid() { $reservation = new TestReservationSeries(); $reservation->WithAttributeValue(new AttributeValue(1, null)); $reservation->WithAttributeValue(new AttributeValue(2, null)); $reservation->WithAttributeValue(new AttributeValue(3, null)); $attributeService = $this->getMock('IAttributeService'); $validationResult = new AttributeServiceValidationResult(true, array()); $attributeService->expects($this->once())->method('Validate')->with($this->equalTo(CustomAttributeCategory::RESERVATION), $this->equalTo($reservation->AttributeValues()))->will($this->returnValue($validationResult)); $rule = new CustomAttributeValidationRule($attributeService); $result = $rule->Validate($reservation); $this->assertEquals(true, $result->IsValid()); }