From dcb0826e314fa08df56eaa4c5042063aeeb108b5 Mon Sep 17 00:00:00 2001 From: Frank Wehrsenger <166113834+wehrsefr@users.noreply.github.com> Date: Wed, 5 Jun 2024 09:24:45 +0200 Subject: [PATCH] fix: fixed wrong description at adv pricing #minor (#32) --- src/CXml/Model/PriceBasisQuantity.php | 6 +++--- .../Model/PunchoutOrderMessageAdvancedPricingTest.php | 5 +++-- .../cxml/samples/PunchoutOrderMessageAdvancedPricing.xml | 4 +--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/CXml/Model/PriceBasisQuantity.php b/src/CXml/Model/PriceBasisQuantity.php index ee96d52..799e6de 100644 --- a/src/CXml/Model/PriceBasisQuantity.php +++ b/src/CXml/Model/PriceBasisQuantity.php @@ -28,9 +28,9 @@ class PriceBasisQuantity * @Ser\SerializedName("Description") * @Ser\XmlElement (cdata=false) */ - private Description $description; + private MultilanguageString $description; - public function __construct(int $quantity, float $conversionFactor, string $unitOfMeasure, Description $description) + public function __construct(int $quantity, float $conversionFactor, string $unitOfMeasure, MultilanguageString $description) { $this->quantity = $quantity; $this->conversionFactor = $conversionFactor; @@ -53,7 +53,7 @@ public function getUnitOfMeasure(): string return $this->unitOfMeasure; } - public function getDescription(): Description + public function getDescription(): MultilanguageString { return $this->description; } diff --git a/tests/CXmlTest/Model/PunchoutOrderMessageAdvancedPricingTest.php b/tests/CXmlTest/Model/PunchoutOrderMessageAdvancedPricingTest.php index 92d8aeb..eb8bcf3 100644 --- a/tests/CXmlTest/Model/PunchoutOrderMessageAdvancedPricingTest.php +++ b/tests/CXmlTest/Model/PunchoutOrderMessageAdvancedPricingTest.php @@ -12,6 +12,7 @@ use CXml\Model\Message\PunchOutOrderMessage; use CXml\Model\Message\PunchOutOrderMessageHeader; use CXml\Model\MoneyWrapper; +use CXml\Model\MultilanguageString; use CXml\Model\PayloadIdentity; use CXml\Model\PriceBasisQuantity; use CXml\Payload\PayloadIdentityFactoryInterface; @@ -32,7 +33,7 @@ protected function setUp(): void $this->dtdValidator = new DtdValidator(__DIR__.'/../../metadata/cxml/dtd/1.2.050/'); } - public function testMinimumExample(): void + public function testMinimumExampleAdvPricing(): void { $from = new Credential( 'DUNS', @@ -61,7 +62,7 @@ public function testMinimumExample(): void [ new Classification('UNSPSC', 'ean1234'), ], - new PriceBasisQuantity(2, 0.5, 'BOX', Description::createWithShortName('1 Box is 2 EA and the unit price is for 2', null, 'en')) + new PriceBasisQuantity(2, 0.5, 'BOX', new MultilanguageString('1 Box is 2 EA and the unit price is for 2', null, 'en')) ) ) ); diff --git a/tests/metadata/cxml/samples/PunchoutOrderMessageAdvancedPricing.xml b/tests/metadata/cxml/samples/PunchoutOrderMessageAdvancedPricing.xml index e94143a..90b8ed9 100644 --- a/tests/metadata/cxml/samples/PunchoutOrderMessageAdvancedPricing.xml +++ b/tests/metadata/cxml/samples/PunchoutOrderMessageAdvancedPricing.xml @@ -42,9 +42,7 @@ EA BOX - - 1 Box is 2 EA and the unit price is for 2 - + 1 Box is 2 EA and the unit price is for 2 ean1234