Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Mar 6, 2018
1 parent ba6ffe0 commit d4fdca3
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ public function testGetNewPromoRule()
->disableOriginalConstructor()
->getMock();

$mailChimpHelperMock = $this->getMockBuilder(Ebizmarts_MailChimp_Helper_Data::class)
->setMethods(array('getDateMicrotime'))
->disableOriginalConstructor()
->getMock();

$promoRulesApiMock->expects($this->once())->method('getMailChimpHelper')->willReturn($mailChimpHelperMock);
$mailChimpHelperMock->expects($this->once())->method('getDateMicrotime')->willReturn('2017-05-18-14-45-54-38849500');
$promoRulesApiMock->expects($this->once())->method('getPromoRule')->with(self::PROMORULE_ID)->willReturn($promoRuleMock);
$promoRulesApiMock->expects($this->once())->method('generateRuleData')->with($promoRuleMock)->willReturn($promoRuleData);

Expand All @@ -78,7 +85,7 @@ public function testGetNewPromoRule()
$this->assertArrayHasKey("body", $return);
$this->assertEquals("POST", $return["method"]);
$this->assertRegExp("/\/ecommerce\/stores\/(.*)\/promo-rules/", $return["path"]);
$this->assertEquals(self::BATCH_ID . "_" . Ebizmarts_MailChimp_Model_Config::IS_PROMO_RULE . '_' . self::PROMORULE_ID, $return["operation_id"]);
$this->assertEquals(self::BATCH_ID . '_' . self::PROMORULE_ID, $return["operation_id"]);
}

public function testMakePromoRulesCollection()
Expand Down

0 comments on commit d4fdca3

Please sign in to comment.