Beispiel #1
0
 public function testAddressTestValidationStateFailure()
 {
     $validation = new Validation();
     $address = new Address();
     $address->setStreet("Test")->setNo(45)->setCity("foo")->setZip("LS12 4TN")->setCountry("GB");
     /**
      * Test Length validation
      */
     $address->setState($this->veryLongString);
     $validation->getValidator($address);
     $data = $validation->performValidation();
     $this->assertValidationReturned('Upg\\Library\\Request\\Objects\\Address', 'state', 'State must between 1 and 80 characters', $data, "State must between 1 and 80 characters failed");
 }
 private function getAddress()
 {
     $address = new Address();
     $address->setStreet("Test")->setNo(45)->setZip("LS12 4TN")->setCity("City")->setState("State")->setCountry("GB");
     return $address;
 }
Beispiel #3
0
 /**
  * @param Processor $processor
  * @param $value
  * @return AmountClass
  */
 public function unserializeProperty(Processor $processor, $value)
 {
     $address = new AddressClass();
     $address->setUnserializedData($value);
     return $address;
 }