diff --git a/src/Request/CreateCampaign.php b/src/Request/CreateCampaign.php index 99a42d1..04c6e1e 100644 --- a/src/Request/CreateCampaign.php +++ b/src/Request/CreateCampaign.php @@ -20,6 +20,8 @@ */ class CreateCampaign { + const DATETIME_FORMAT = 'YmdHmi'; + /** * @var \XMLWriter $writer */ @@ -92,7 +94,7 @@ private function campaign(Campaign $campaign) 'NAME' => $campaign->getName(), 'STATE' => $campaign->getState(), 'FOLDERID' => $campaign->getFolderId(), - 'START_DT' => $campaign->getStartDate()->format('Ymdhmi'), + 'START_DT' => $campaign->getStartDate()->format(self::DATETIME_FORMAT), 'DESCRIPTION' => $campaign->getDescription(), 'MACATEGORY' => $campaign->getMaCategory(), 'PRODUCTID' => $campaign->getProductId(), diff --git a/tests/Broadcast/CampaignTest.php b/tests/Broadcast/CampaignTest.php index c948f1d..930cae6 100644 --- a/tests/Broadcast/CampaignTest.php +++ b/tests/Broadcast/CampaignTest.php @@ -49,7 +49,7 @@ public function testXml() $this->assertEquals($campaign->getName(), (string) $document->CAMPAIGN['NAME']); $this->assertEquals($campaign->getFolderId(), (int) $document->CAMPAIGN['FOLDERID']); $this->assertEquals($campaign->getState(), (string) $document->CAMPAIGN['STATE']); - $this->assertEquals($campaign->getStartDate()->format('Ymdhmi'), (string) $document->CAMPAIGN['START_DT']); + $this->assertEquals($campaign->getStartDate()->format(CreateCampaign::DATETIME_FORMAT), (string) $document->CAMPAIGN['START_DT']); $this->assertEquals($campaign->getDescription(), (string) $document->CAMPAIGN['DESCRIPTION']); $this->assertEquals($campaign->getMaCategory(), (string) $document->CAMPAIGN['MACATEGORY']); $this->assertEquals($campaign->getProductId(), (int) $document->CAMPAIGN['PRODUCTID']);