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

Commit

Permalink
Add custom report option
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbrink committed May 3, 2020
1 parent 4313f31 commit 58c7b3c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/AmazonReportRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,17 @@ public function setReportType($s)
*/
}

/**
* Sets whether or not to use the custom report (Optional).
*
* @param bool $custom
* @return void
*/
public function setCustomReport(bool $custom)
{
$this->options['ReportOptions=custom'] = $custom;
}

/**
* Sets the time frame options. (Optional).
*
Expand Down
16 changes: 16 additions & 0 deletions tests/classes/AmazonReportRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@ public function testSetMarketplaces()
$this->assertArrayNotHasKey('MarketplaceIdList.Id.1', $o3);
}

public function testSetCustomReport()
{
$o = $this->object->getOptions();
$this->assertArrayNotHasKey('ReportOptions=custom', $o);

$this->object->setCustomReport(true);
$o2 = $this->object->getOptions();
$this->assertArrayHasKey('ReportOptions=custom', $o2);
$this->assertTrue($o2['ReportOptions=custom']);

$this->object->setCustomReport(false);
$o3 = $this->object->getOptions();
$this->assertArrayHasKey('ReportOptions=custom', $o3);
$this->assertFalse($o3['ReportOptions=custom']);
}

public function testRequestReport()
{
resetLog();
Expand Down

0 comments on commit 58c7b3c

Please sign in to comment.