Skip to content

Commit 3811d36

Browse files
committed
Merge branch 'hotfix/functional-tests-fail' of github.com:lbajsarowicz/magento2 into 2.4-develop-forward-port
2 parents 06e34bb + 84b1310 commit 3811d36

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<actionGroup ref="logout" stepKey="logout"/>
2828
</after>
2929
<!-- Generate the datetime default value -->
30-
<generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/>
30+
<generateDate date="now" format="n/j/y g:i A" stepKey="generateDefaultValue"/>
3131
<!-- Create new datetime product attribute -->
3232
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/>
3333
<waitForPageLoad stepKey="waitForPageLoadAttributes"/>

dev/tests/integration/testsuite/Magento/Reports/Model/ResourceModel/Report/Product/Viewed/CollectionTest.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ public function testTableSelection($period, $expectedTable, $dateFrom, $dateTo,
7272
$this->assertArrayHasKey('tableName', $from[$dbTableName]);
7373
} else {
7474
$union = $this->_collection->getSelect()->getPart('union');
75+
$count = count($union);
7576
if ($period !== null && $dateFrom !== null && $dateTo !== null && $period != 'month') {
76-
$count = count($union);
7777
if ($period == 'year') {
7878
if ($dbTableName == "report_viewed_product_aggregated_daily") {
79-
$this->assertEquals($count, 2);
79+
$this->assertEquals(2, $count);
8080
}
8181
if ($dbTableName == "report_viewed_product_aggregated_yearly") {
82-
$this->assertEquals($count, 3);
82+
$this->assertEquals(3, $count);
8383
}
8484
} else {
85-
$this->assertEquals($count, 3);
85+
$this->assertEquals(3, $count);
8686
}
8787
} else {
88-
$this->assertEquals(count($union), 2);
88+
$this->assertEquals(2, $count);
8989
}
9090
}
9191
}
@@ -98,8 +98,8 @@ public function testTableSelection($period, $expectedTable, $dateFrom, $dateTo,
9898
*/
9999
public function tableForPeriodDataProvider()
100100
{
101-
$dateNow = date('Y-m-d', time());
102-
$dateYearAgo = date('Y-m-d', strtotime($dateNow . ' -1 year'));
101+
$dateFrom = '2019-10-15';
102+
$dateYearBefore = date('Y-m-d', strtotime($dateFrom . ' -1 year'));
103103
return [
104104
[
105105
'period' => 'year',
@@ -111,32 +111,32 @@ public function tableForPeriodDataProvider()
111111
[
112112
'period' => 'year',
113113
'table' => 'report_viewed_product_aggregated_yearly',
114-
'date_from' => $dateYearAgo,
115-
'date_to' => $dateNow,
114+
'date_from' => $dateYearBefore,
115+
'date_to' => $dateFrom,
116116
],
117117
[
118118
'period' => 'year',
119119
'table' => 'report_viewed_product_aggregated_yearly',
120-
'date_from' => $dateYearAgo,
120+
'date_from' => $dateYearBefore,
121121
'date_to' => null,
122122
],
123123
[
124124
'period' => 'month',
125125
'table' => 'report_viewed_product_aggregated_monthly',
126126
'date_from' => null,
127-
'date_to' => $dateNow,
127+
'date_to' => $dateFrom,
128128
],
129129
[
130130
'period' => 'year',
131131
'table' => 'report_viewed_product_aggregated_yearly',
132-
'date_from' => $dateYearAgo,
132+
'date_from' => $dateYearBefore,
133133
'date_to' => null,
134134
],
135135
[
136136
'period' => 'year',
137137
'table' => 'report_viewed_product_aggregated_yearly',
138138
'date_from' => null,
139-
'date_to' => $dateNow,
139+
'date_to' => $dateFrom,
140140
],
141141
[
142142
'period' => 'month',
@@ -147,19 +147,19 @@ public function tableForPeriodDataProvider()
147147
[
148148
'period' => 'month',
149149
'table' => 'report_viewed_product_aggregated_monthly',
150-
'date_from' => $dateYearAgo,
151-
'date_to' => $dateYearAgo,
150+
'date_from' => $dateYearBefore,
151+
'date_to' => $dateYearBefore,
152152
],
153153
[
154154
'period' => 'month',
155155
'table' => 'report_viewed_product_aggregated_monthly',
156156
'date_from' => null,
157-
'date_to' => $dateYearAgo,
157+
'date_to' => $dateYearBefore,
158158
],
159159
[
160160
'period' => 'month',
161161
'table' => 'report_viewed_product_aggregated_monthly',
162-
'date_from' => $dateYearAgo,
162+
'date_from' => $dateYearBefore,
163163
'date_to' => null,
164164
],
165165
[
@@ -177,32 +177,32 @@ public function tableForPeriodDataProvider()
177177
[
178178
'period' => null,
179179
'table' => 'report_viewed_product_aggregated_daily',
180-
'date_from' => $dateYearAgo,
181-
'date_to' => $dateNow,
180+
'date_from' => $dateYearBefore,
181+
'date_to' => $dateFrom,
182182
],
183183
[
184184
'period' => null,
185185
'table' => 'report_viewed_product_aggregated_daily',
186-
'date_from' => $dateNow,
187-
'date_to' => $dateNow,
186+
'date_from' => $dateFrom,
187+
'date_to' => $dateFrom,
188188
],
189189
[
190190
'period' => 'day',
191191
'table' => 'report_viewed_product_aggregated_daily',
192-
'date_from' => $dateYearAgo,
193-
'date_to' => $dateYearAgo,
192+
'date_from' => $dateYearBefore,
193+
'date_to' => $dateYearBefore,
194194
],
195195
[
196196
'period' => 'year',
197197
'table' => 'report_viewed_product_aggregated_daily',
198-
'date_from' => $dateYearAgo,
199-
'date_to' => $dateYearAgo,
198+
'date_from' => $dateYearBefore,
199+
'date_to' => $dateYearBefore,
200200
],
201201
[
202202
'period' => 'year',
203203
'table' => 'report_viewed_product_aggregated_daily',
204204
'date_from' => null,
205-
'date_to' => $dateYearAgo,
205+
'date_to' => $dateYearBefore,
206206
],
207207
[
208208
'period' => null,

0 commit comments

Comments
 (0)