1 | <?php |
||
2 | |||
3 | namespace SilverShop\Tests\Reports; |
||
4 | |||
5 | use SilverShop\Reports\ShopSalesReport; |
||
6 | use SilverStripe\Dev\SapphireTest; |
||
7 | |||
8 | class ShopReportTest extends SapphireTest |
||
9 | { |
||
10 | protected static $fixture_file = __DIR__ . '/../Fixtures/shop.yml'; |
||
11 | |||
12 | function testSalesReport() |
||
13 | { |
||
14 | $report = new ShopSalesReport(); |
||
15 | $records = $report->sourceRecords(array()); |
||
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
16 | $records = $report->sourceRecords(array('Grouping' => 'Year')); |
||
17 | $records = $report->sourceRecords(array('Grouping' => 'Month')); |
||
18 | $records = $report->sourceRecords(array('Grouping' => 'Week')); |
||
19 | $records = $report->sourceRecords( |
||
20 | array( |
||
21 | 'Grouping' => 'Day', |
||
22 | 'StartPeriod' => 'May 1, 2010', |
||
23 | 'EndPeriod' => 'May 16, 2111', |
||
24 | ) |
||
25 | ); |
||
26 | $record = $records->first(); |
||
27 | $this->assertEquals("02 October 2012 - Tuesday", $record->FilterPeriod); |
||
28 | $this->assertEquals(1, $record->Count, "One sale on this day"); |
||
29 | } |
||
30 | } |
||
31 |