private function assertAgeDate(AgeDate $result) { $this->assertEquals('CAN.FNQ', $result->getType()); $this->assertEquals(new DateTime('2015-12-30'), $result->getValue()); }
/** * @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); }