Example #1
0
 private function assertAgeDate(AgeDate $result)
 {
     $this->assertEquals('CAN.FNQ', $result->getType());
     $this->assertEquals(new DateTime('2015-12-30'), $result->getValue());
 }
Example #2
0
 /**
  * @param SimpleXMLElement $document
  * @return AgeDate
  */
 public function extractAgeDate(SimpleXMLElement $document)
 {
     $object = new AgeDate();
     $fields = ['type' => 'type', 'value' => function (AgeDate $object, $value) {
         $object->setValue(new DateTime($value));
     }];
     return $this->transform($document, $fields, $object);
 }