Skip to content

Commit

Permalink
added a couple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Crowe committed Dec 5, 2014
1 parent edca3de commit 223c9f9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Credibility/DandB/Models/DandBOrder.php
Expand Up @@ -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;
}
Expand Down
28 changes: 25 additions & 3 deletions tests/DandBTest.php
Expand Up @@ -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(
Expand Down

0 comments on commit 223c9f9

Please sign in to comment.