public function setUp() { $this->_jsonData = json_decode(file_get_contents(__DIR__ . '/../../tests/JsonResponses/CampaignSummaryJson.html'), true)['Context']; $this->_campaignSummary = CampaignSummary::withJSON($this->_jsonData); }
public function onParse($jsonData) { return CampaignSummary::withJSON($jsonData); }
/** * 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); }