Skip to content

Commit

Permalink
Fix Tests -> Use expectExceptionMessage instead of expectErrorMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 5, 2023
1 parent 1430af1 commit 4b2961f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
26 changes: 13 additions & 13 deletions tests/testcases/OrderObjectHelperBasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ public function testGetCodeType2(): void

$this->assertEquals("", self::$objectHelper->getCodeType2("", "listid", "listversionid")->value());

$this->expectErrorMessage("Call to undefined method horstoeko\orderx\\entities\basic\udt\CodeType::getListID()");
$this->expectExceptionMessage("Call to undefined method horstoeko\orderx\\entities\basic\udt\CodeType::getListID()");
$this->assertEquals("", self::$objectHelper->getCodeType2("Code")->getListID());
$this->expectErrorMessage("Call to undefined method horstoeko\orderx\\entities\basic\udt\CodeType::getListVersionID()");
$this->expectExceptionMessage("Call to undefined method horstoeko\orderx\\entities\basic\udt\CodeType::getListVersionID()");
$this->assertEquals("", self::$objectHelper->getCodeType2("Code")->getListVersionID());
}

Expand Down Expand Up @@ -275,7 +275,7 @@ public function testGetNoteType(): void
$this->assertEquals("SC", self::$objectHelper->getNoteType("Content", null, "SC")->getSubjectCode());
$this->assertEquals("", self::$objectHelper->getNoteType("Content", "CC", null)->getSubjectCode());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\NoteType::getContentCode()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\NoteType::getContentCode()');
$this->assertEquals("CC", self::$objectHelper->getNoteType("Content", "CC", "SC")->getContentCode());
$this->assertEquals("", self::$objectHelper->getNoteType("Content", "", "SC")->getContentCode());
$this->assertEquals("CC", self::$objectHelper->getNoteType("Content", "CC", "")->getContentCode());
Expand Down Expand Up @@ -523,7 +523,7 @@ public function testGetTradeParty(): void
$this->assertEquals("NAME", self::$objectHelper->getTradeParty("NAME", "ID", "DESC")->getName()->value());
$this->assertEquals("ID", self::$objectHelper->getTradeParty("NAME", "ID", "DESC")->getID()->value());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradePartyType::getDescription()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradePartyType::getDescription()');
$this->assertEquals("DESC", self::$objectHelper->getTradeParty("NAME", "ID", "DESC")->getDescription()->value());
}

Expand Down Expand Up @@ -640,7 +640,7 @@ public function testGetTradeContact(): void
$this->assertEquals("EMAIL", $contact->getEmailURIUniversalCommunication()->getURIID()->value());
$this->assertNull($contact->getEmailURIUniversalCommunication()->getURIID()->getSchemeID());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\TradeContactType::getFaxUniversalCommunication()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\TradeContactType::getFaxUniversalCommunication()');
$this->assertEquals("FAX", $contact->getFaxUniversalCommunication()->getCompleteNumber());
}

Expand Down Expand Up @@ -709,9 +709,9 @@ public function testGetTradeDeliveryTermsType(): void
$this->assertEquals("CODE", $devTermsType->getDeliveryTypeCode()->value());
$this->assertEquals("FUNCCODE", $devTermsType->getFunctionCode()->value());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeDeliveryTermsType::getDescription()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeDeliveryTermsType::getDescription()');
$this->assertEquals("DESC", $devTermsType->getDescription()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeDeliveryTermsType::getRelevantTradeLocation()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeDeliveryTermsType::getRelevantTradeLocation()');
$this->assertEquals("LOCID", $devTermsType->getRelevantTradeLocation()->getID()->value());
$this->assertEquals("LOCNAME", $devTermsType->getRelevantTradeLocation()->getName()->value());
}
Expand Down Expand Up @@ -895,7 +895,7 @@ public function testGetTradeAccountingAccountType(): void
$this->assertNotNull(self::$objectHelper->getTradeAccountingAccountType("ID", "TYPECODE"));

$this->assertEquals("ID", self::$objectHelper->getTradeAccountingAccountType("ID", "TYPECODE")->getId()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeAccountingAccountType::getTypeCode()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeAccountingAccountType::getTypeCode()');
$this->assertEquals("TYPECODE", self::$objectHelper->getTradeAccountingAccountType("ID", "TYPECODE")->getTypeCode()->value());
}

Expand Down Expand Up @@ -946,9 +946,9 @@ public function testGetTradeProductType(): void
$this->assertEquals("BUYERID", $product->getBuyerAssignedID()->value());
$this->assertEquals("GID", $product->getGlobalID()->value());
$this->assertEquals("GIDTYPE", $product->getGlobalID()->getSchemeID());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeProductType::getBatchID()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeProductType::getBatchID()');
$this->assertEquals("BATCHID", $product->getBatchID()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeProductType::getBrandName()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\basic\ram\TradeProductType::getBrandName()');
$this->assertEquals("BRANDNAME", $product->getBrandName()->value());
}

Expand Down Expand Up @@ -1019,9 +1019,9 @@ public function testGetReferencedProductType(): void
$this->assertEquals("SELLERID", $product->getSellerAssignedID()->value());
$this->assertEquals("BUYERID", $product->getBuyerAssignedID()->value());
$this->assertEquals("NAME", $product->getName()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\ReferencedProductType::getDescription()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\ReferencedProductType::getDescription()');
$this->assertEquals("DESC", $product->getDescription()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\ReferencedProductType::getUnitQuantity()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\ReferencedProductType::getUnitQuantity()');
$this->assertEquals(5, $product->getUnitQuantity()->value());
$this->assertEquals("C62", $product->getUnitQuantity()->getUnitCode());
}
Expand Down Expand Up @@ -1092,7 +1092,7 @@ public function testGetTradeSettlementLineMonetarySummationType(): void

$this->assertNotNull($summation);
$this->assertEquals(100.0, $summation->getLineTotalAmount()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\TradeSettlementLineMonetarySummationType::getTotalAllowanceChargeAmount()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\\entities\basic\ram\TradeSettlementLineMonetarySummationType::getTotalAllowanceChargeAmount()');
$this->assertEquals(50.0, $summation->getTotalAllowanceChargeAmount()->value());
}

Expand Down
14 changes: 7 additions & 7 deletions tests/testcases/OrderObjectHelperComfortTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function testGetNoteType(): void
$this->assertEquals("SC", self::$objectHelper->getNoteType("Content", null, "SC")->getSubjectCode());
$this->assertEquals("", self::$objectHelper->getNoteType("Content", "CC", null)->getSubjectCode());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\NoteType::getContentCode()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\NoteType::getContentCode()');
$this->assertEquals("CC", self::$objectHelper->getNoteType("Content", "CC", "SC")->getContentCode());
$this->assertEquals("", self::$objectHelper->getNoteType("Content", "", "SC")->getContentCode());
$this->assertEquals("CC", self::$objectHelper->getNoteType("Content", "CC", "")->getContentCode());
Expand Down Expand Up @@ -675,7 +675,7 @@ public function testGetTradeContact(): void
$this->assertEquals("EMAIL", $contact->getEmailURIUniversalCommunication()->getURIID()->value());
$this->assertNull($contact->getEmailURIUniversalCommunication()->getURIID()->getSchemeID());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeContactType::getFaxUniversalCommunication()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeContactType::getFaxUniversalCommunication()');
$this->assertEquals("FAX", $contact->getFaxUniversalCommunication()->getCompleteNumber());
}

Expand Down Expand Up @@ -880,7 +880,7 @@ public function testGetTradeTaxType(): void
$this->assertEquals("S", $tradeTax->getCategoryCode()->value());
$this->assertEquals("VAT", $tradeTax->getTypeCode()->value());
$this->assertEquals(19.0, $tradeTax->getRateApplicablePercent()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeTaxType::getBasisAmount()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeTaxType::getBasisAmount()');
$this->assertEquals(100.0, $tradeTax->getBasisAmount()->value());
$this->assertEquals(19.0, $tradeTax->getCalculatedAmount()->value());
$this->assertEquals("Reason", $tradeTax->getExemptionReason()->value());
Expand Down Expand Up @@ -911,7 +911,7 @@ public function testGetTradeAllowanceChargeType(): void
$this->assertEquals("Reason", $allowanceCharge->getReason()->value());
$this->assertEquals("RC", $allowanceCharge->getReasonCode()->value());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeAllowanceChargeType::getBasisQuantity()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeAllowanceChargeType::getBasisQuantity()');
$this->assertEquals(5, $allowanceCharge->getBasisQuantity()->value());
$this->assertEquals("C62", $allowanceCharge->getBasisQuantity()->getUnitCode());
}
Expand Down Expand Up @@ -1038,7 +1038,7 @@ public function testGetProductCharacteristicType(): void
$this->assertEquals("DESC", $characteristic->getDescription());
$this->assertEquals("VALUE", $characteristic->getValue()->value());

$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\ProductCharacteristicType::getValueMeasure()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\ProductCharacteristicType::getValueMeasure()');
$this->assertEquals(2.00, $characteristic->getValueMeasure()->value());
$this->assertEquals("C62", $characteristic->getValueMeasure()->getUnitCode());
}
Expand Down Expand Up @@ -1094,7 +1094,7 @@ public function testGetReferencedProductType(): void
$this->assertEquals("BUYERID", $product->getBuyerAssignedID()->value());
$this->assertEquals("NAME", $product->getName()->value());
$this->assertEquals("DESC", $product->getDescription()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\ReferencedProductType::getUnitQuantity()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\ReferencedProductType::getUnitQuantity()');
$this->assertEquals(5, $product->getUnitQuantity()->value());
$this->assertEquals("C62", $product->getUnitQuantity()->getUnitCode());
}
Expand Down Expand Up @@ -1174,7 +1174,7 @@ public function testGetTradeSettlementLineMonetarySummationType(): void

$this->assertNotNull($summation);
$this->assertEquals(100.0, $summation->getLineTotalAmount()->value());
$this->expectErrorMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeSettlementLineMonetarySummationType::getTotalAllowanceChargeAmount()');
$this->expectExceptionMessage('Call to undefined method horstoeko\orderx\entities\comfort\ram\TradeSettlementLineMonetarySummationType::getTotalAllowanceChargeAmount()');
$this->assertEquals(50.0, $summation->getTotalAllowanceChargeAmount()->value());
}

Expand Down

0 comments on commit 4b2961f

Please sign in to comment.