コード例 #1
0
 public function setUp()
 {
     $this->_jsonData = json_decode(file_get_contents(__DIR__ . '/../../tests/JsonResponses/CampaignSummaryJson.html'), true)['Context'];
     $this->_campaignSummary = CampaignSummary::withJSON($this->_jsonData);
 }
コード例 #2
0
 public function onParse($jsonData)
 {
     return CampaignSummary::withJSON($jsonData);
 }
コード例 #3
0
 /**
  * Test if CampaignSummary returns a Campaign object when onParse is called.
  * @group CampaignSummaryActionTest
  * @covers moosend\Actions\CampaignSummary\CampaignSummaryAction::onParse
  */
 public function test_Should_Return_Campaign_Object_When_CloneAction_Calls_onParse()
 {
     $returnedCampaignObject = $this->_action->onParse($this->_jsonData['Context']);
     $expectedCampaignObject = CampaignSummary::withJSON($this->_jsonData['Context']);
     $this->assertEquals($expectedCampaignObject, $returnedCampaignObject);
 }