Skip to content

Commit

Permalink
UBR-53: The actual response from the API is different than documented…
Browse files Browse the repository at this point in the history
…, so some changes were needed.
  • Loading branch information
bertramakers committed Jun 19, 2015
1 parent 1dabed4 commit 4d2b825
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CultureFeed/CultureFeed/Uitpas/Default.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function getPassholderByIdentificationNumber($identification_number, $con
throw new CultureFeed_ParseException($result);
}

$object = $xml->xpath('/passHolder', false);
$object = $xml->xpath('/response/passholder', false);

return CultureFeed_Uitpas_Passholder::createFromXml($object);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ public function testCreatePassholder() {

public function testGetPassholderByIdentificationNumber()
{
$passholder_xml = file_get_contents(dirname(__FILE__) . '/data/passholder.xml');
$passholder_xml = file_get_contents(dirname(__FILE__) . '/data/passholder-retrieve.xml');

$data = array(
'identification' => '1000001500601',
'identification' => '0100000099909',
'balieConsumerKey' => 'some-key',
);

Expand All @@ -83,7 +83,7 @@ public function testGetPassholderByIdentificationNumber()
);

$actualUitpasNumber = $passholder
->cardSystemSpecific[6]
->cardSystemSpecific[2]
->currentCard
->uitpasNumber;

Expand Down
37 changes: 37 additions & 0 deletions CultureFeed/test/uitpas/data/passholder-retrieve.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:cdb="http://www.cultuurdatabank.com/XMLSchema/CdbXSD/3.1/FINAL">
<code>ACTION_SUCCEEDED</code>
<passholder>
<email>foo.bar.scarlet.be@mailinator.com</email>
<postalCode>8730</postalCode>
<gender>MALE</gender>
<uitIdUser>
<rdf:id>5797382b-ee1e-49a7-9092-b8f097643e62</rdf:id>
</uitIdUser>
<registrationBalieConsumerKey>39d138ab-1153-42c7-85d6-a398c9fc77c3</registrationBalieConsumerKey>
<numberOfCheckins>11</numberOfCheckins>
<verified>false</verified>
<points>3.000</points>
<cardSystemSpecific>
<cardSystem>
<id>2</id>
<name>Cirk!</name>
</cardSystem>
<currentCard>
<kansenpas>false</kansenpas>
<status>ACTIVE</status>
<uitpasNumber>
<uitpasNumber>0100000099909</uitpasNumber>
</uitpasNumber>
</currentCard>
<emailPreference>ALL_MAILS</emailPreference>
<kansenStatuut>false</kansenStatuut>
<kansenStatuutExpired>false</kansenStatuutExpired>
<kansenStatuutInGracePeriod>false</kansenStatuutInGracePeriod>
<lastActivationMailNumber>1</lastActivationMailNumber>
<smsPreference>NO_SMS</smsPreference>
<status>ACTIVE</status>
</cardSystemSpecific>
<memberships/>
</passholder>
</response>

0 comments on commit 4d2b825

Please sign in to comment.