WIP: Implement closer BPN integration
This commit is contained in:
@@ -92,24 +92,6 @@ class ResponseParserTest extends TestCase
|
||||
$this->assertEquals('Gaststätte', $hotel->getType());
|
||||
}
|
||||
|
||||
public function testParseSuccessfulProductsResponse(): void
|
||||
{
|
||||
$content = '<?xml version="1.0" encoding="utf-8" ?><ergebnis><satz typ="PRODUKTE" /><produkte><produkt id="389" code="ANDA" bezeichnung="Andalusien" /><produkt id="483" code="PORTFL" bezeichnung="Portugal -Algarve Flugreise" /><produkt id="490" code="MALL" bezeichnung="Mallorca Flugreise" /></produkte></ergebnis>';
|
||||
|
||||
$parser = $this->getParserInstance();
|
||||
$response = $parser->parseXmlString(ApiClient::TYPE_PRODUCTS, $content);
|
||||
|
||||
$this->assertInstanceOf(BaseDataResponse::class, $response);
|
||||
|
||||
$products = $response->getItems();
|
||||
$this->assertCount(3, $products);
|
||||
|
||||
$product = reset($products);
|
||||
$this->assertEquals(389, $product->getId());
|
||||
$this->assertEquals('ANDA', $product->getCode());
|
||||
$this->assertEquals('Andalusien', $product->getName());
|
||||
}
|
||||
|
||||
private function getParserInstance(): ResponseParser
|
||||
{
|
||||
return new ResponseParser([
|
||||
|
||||
Reference in New Issue
Block a user