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()
3939 */
4040 public function testGetByPeriodWithParam (int $ expectedDataQty , string $ period , string $ chartParam ): void
4141 {
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 );
4347 }
4448
4549 /**
@@ -51,27 +55,27 @@ public function getChartDataProvider(): array
5155 {
5256 return [
5357 [
54- 10 ,
58+ 2 ,
5559 '24h ' ,
5660 'quantity '
5761 ],
5862 [
59- 4 ,
63+ 3 ,
6064 '7d ' ,
6165 'quantity '
6266 ],
6367 [
64- 10 ,
68+ 4 ,
6569 '1m ' ,
6670 'quantity '
6771 ],
6872 [
69- 8 ,
73+ 5 ,
7074 '1y ' ,
7175 'quantity '
7276 ],
7377 [
74- 15 ,
78+ 6 ,
7579 '2y ' ,
7680 'quantity '
7781 ]
Original file line number Diff line number Diff line change 5555 'base_grand_total ' => 140.00 ,
5656 'grand_total ' => 140.00 ,
5757 '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 ),
5959 ],
6060 [
6161 'increment_id ' => '100000005 ' ,
6565 'base_grand_total ' => 150.00 ,
6666 'grand_total ' => 150.00 ,
6767 '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 ),
6969 ],
7070 [
7171 'increment_id ' => '100000006 ' ,
7575 'base_grand_total ' => 160.00 ,
7676 'grand_total ' => 160.00 ,
7777 '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 ),
7979 ],
8080];
8181
You can’t perform that action at this time.
0 commit comments