File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
dev/tests/integration/testsuite/Magento Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,11 @@ protected function setUp()
39
39
*/
40
40
public function testGetByPeriodWithParam (int $ expectedDataQty , string $ period , string $ chartParam ): void
41
41
{
42
- $ this ->assertGreaterThan ($ expectedDataQty , $ this ->model ->getByPeriod ($ period , $ chartParam ));
42
+ $ ordersData = $ this ->model ->getByPeriod ($ period , $ chartParam );
43
+ $ ordersCount = array_sum (array_map (function ($ item ) {
44
+ return $ item ['y ' ];
45
+ }, $ ordersData ));
46
+ $ this ->assertGreaterThanOrEqual ($ expectedDataQty , $ ordersCount );
43
47
}
44
48
45
49
/**
@@ -51,27 +55,27 @@ public function getChartDataProvider(): array
51
55
{
52
56
return [
53
57
[
54
- 10 ,
58
+ 2 ,
55
59
'24h ' ,
56
60
'quantity '
57
61
],
58
62
[
59
- 4 ,
63
+ 3 ,
60
64
'7d ' ,
61
65
'quantity '
62
66
],
63
67
[
64
- 10 ,
68
+ 4 ,
65
69
'1m ' ,
66
70
'quantity '
67
71
],
68
72
[
69
- 8 ,
73
+ 5 ,
70
74
'1y ' ,
71
75
'quantity '
72
76
],
73
77
[
74
- 15 ,
78
+ 6 ,
75
79
'2y ' ,
76
80
'quantity '
77
81
]
Original file line number Diff line number Diff line change 55
55
'base_grand_total ' => 140.00 ,
56
56
'grand_total ' => 140.00 ,
57
57
'subtotal ' => 140.00 ,
58
- 'created_at ' => $ dateTime ->modify ('-1 month ' )->format (DateTime::DATETIME_PHP_FORMAT ),
58
+ 'created_at ' => $ dateTime ->modify ('first day of this month ' )->format (DateTime::DATETIME_PHP_FORMAT ),
59
59
],
60
60
[
61
61
'increment_id ' => '100000005 ' ,
65
65
'base_grand_total ' => 150.00 ,
66
66
'grand_total ' => 150.00 ,
67
67
'subtotal ' => 150.00 ,
68
- 'created_at ' => $ dateTime ->modify ('-1 year ' )->format (DateTime::DATETIME_PHP_FORMAT ),
68
+ 'created_at ' => $ dateTime ->modify ('first day of january this year ' )->format (DateTime::DATETIME_PHP_FORMAT ),
69
69
],
70
70
[
71
71
'increment_id ' => '100000006 ' ,
75
75
'base_grand_total ' => 160.00 ,
76
76
'grand_total ' => 160.00 ,
77
77
'subtotal ' => 160.00 ,
78
- 'created_at ' => $ dateTime ->modify ('-2 year ' )->format (DateTime::DATETIME_PHP_FORMAT ),
78
+ 'created_at ' => $ dateTime ->modify ('first day of january last year ' )->format (DateTime::DATETIME_PHP_FORMAT ),
79
79
],
80
80
];
81
81
You can’t perform that action at this time.
0 commit comments