Skip to content

Commit

Permalink
UBR-118: Identity now uses CultureFeed_Uitpas_Passholder_Card instead…
Browse files Browse the repository at this point in the history
… of CultureFeed_Uitpas_CardInfo as the type of its card property.
  • Loading branch information
bertramakers committed Jul 30, 2015
1 parent dcfea88 commit 0fadc9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
10 changes: 1 addition & 9 deletions CultureFeed/CultureFeed/Uitpas/CardInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,8 @@ class CultureFeed_Uitpas_CardInfo {
public static function createFromXml(CultureFeed_SimpleXMLElement $object) {
$instance = new static();

$cardSystemXml = $object->xpath('cardSystem', FALSE);
if ($cardSystemXml instanceof CultureFeed_SimpleXMLElement) {
$instance->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($cardSystemXml);
}

$instance->cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($object->xpath('cardSystem', FALSE));
$instance->uitpasNumber = $object->xpath_str('uitpasNumber');
if (empty($instance->uitpasNumber)) {
$instance->uitpasNumber = $object->xpath_str('uitpasNumber/uitpasNumber');
}

$instance->status = $object->xpath_str('status');

return $instance;
Expand Down
4 changes: 2 additions & 2 deletions CultureFeed/CultureFeed/Uitpas/Identity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class CultureFeed_Uitpas_Identity extends CultureFeed_Uitpas_ValueObject {
/**
* @var \CultureFeed_Uitpas_CardInfo
* @var \CultureFeed_Uitpas_Passholder_Card
*/
public $card;

Expand All @@ -19,7 +19,7 @@ public static function createFromXml(CultureFeed_SimpleXMLElement $object) {
$identity = new static();

$cardXml = $object->xpath('card', false);
$identity->card = CultureFeed_Uitpas_CardInfo::createFromXml($cardXml);
$identity->card = CultureFeed_Uitpas_Passholder_Card::createFromXml($cardXml);

$passHolderXml = $object->xpath('passHolder', false);
if ($passHolderXml instanceof CultureFeed_SimpleXMLElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public function testIndentify()

$this->assertInstanceOf('CultureFeed_Uitpas_Identity', $identity);

$this->assertInstanceOf('CultureFeed_Uitpas_CardInfo', $identity->card);
$this->assertInstanceOf('CultureFeed_Uitpas_Passholder_Card', $identity->card);
$this->assertEquals($data['identification'], $identity->card->uitpasNumber);
$this->assertEquals('ACTIVE', $identity->card->status);
$this->assertFalse($identity->card->kansenStatuut());
$this->assertNull($identity->card->cardSystem);
$this->assertFalse($identity->card->kansenpas);
$this->assertEmpty($identity->card->city);

$this->assertInstanceOf('CultureFeed_Uitpas_Passholder', $identity->passHolder);
$this->assertEquals('Boadu', $identity->passHolder->name);
Expand Down

0 comments on commit 0fadc9b

Please sign in to comment.