From 223c9f9f085243f4a58357dffb97c6e2ac672ce1 Mon Sep 17 00:00:00 2001 From: Jon Crowe Date: Fri, 5 Dec 2014 12:49:39 -0800 Subject: [PATCH] added a couple tests --- src/Credibility/DandB/Models/DandBOrder.php | 4 +-- tests/DandBTest.php | 28 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Credibility/DandB/Models/DandBOrder.php b/src/Credibility/DandB/Models/DandBOrder.php index 29d7ef8..72c244f 100644 --- a/src/Credibility/DandB/Models/DandBOrder.php +++ b/src/Credibility/DandB/Models/DandBOrder.php @@ -36,10 +36,10 @@ public function setPaymentType($type) { } /** - * @param bool $sendEmail - defaults is false + * @param $sendEmail - defaults is false * @returns this */ - public function setSendConfirmationEmail(bool $sendEmail) { + public function setSendConfirmationEmail($sendEmail) { $this->sendConfirmationEmail = $sendEmail; return $this; } diff --git a/tests/DandBTest.php b/tests/DandBTest.php index 7479310..2a59717 100644 --- a/tests/DandBTest.php +++ b/tests/DandBTest.php @@ -221,10 +221,32 @@ public function testAddUserEntitlements() public function testAddSingleProductUserEntitlement() { $userToken = 'abcde123'; - $order = new Models\DandBOrder(); - $order->addProduct((new Models\DandBProduct())->setProductId('1')->setPriceId('2')); + $order = (new Models\DandBOrder()) + ->setPaymentTypeCode('FREE') + ->setOrderLevelPromotionIdentifier(1) + ->setFive9SessionIdentifier(1) + ->setCustomerGroupDomainCode(1) + ->setCaseLevelIdentifier(1) + ->setPaymentType('FREE') + ->setPartnerIdentifier(1) + ->setSendConfirmationEmail(false); + + $order->addProduct( + (new Models\DandBProduct()) + ->setProductId('1') + ->setPriceId('2') + ->setQuantity(1) + ->setPromotionIdentifier(null) + ->setPaymentSubTypeCode('FREE') + ->setPaymentInstrumentIdentifier('FREE') + ); $product = $order->getFirstProduct(); - $agent = new Models\DandBAgent(); + $agent = (new Models\DandBAgent()) + ->setAssignedAgentCode(1) + ->setAgentOfficeCode(1) + ->setAgentId(1); + + $order->setAgent($agent); $this->setMockRequesterExpectations('runPost', '/v1.1/user/entitlement', array(