Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from methylbro/fix-startdt-format-in-xml
Browse files Browse the repository at this point in the history
fix #17 START_DT format in sent XML Campaign
  • Loading branch information
methylbro authored Dec 7, 2016
2 parents d4434da + c96a1b9 commit 9ec9373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Request/CreateCampaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
class CreateCampaign
{
const DATETIME_FORMAT = 'YmdHmi';

/**
* @var \XMLWriter $writer
*/
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Broadcast/CampaignTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 9ec9373

Please sign in to comment.