Skip to content

Commit 94662a9

Browse files
CE-33709: Added warning for few tests if input data is incorrect (data provider scope, in the previous version of PHPUnit warning was thrown by default)
1 parent 01f8d7f commit 94662a9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ public function paymentMethodDataProvider()
106106
$helper = Bootstrap::getObjectManager()->get(\Magento\Payment\Helper\Data::class);
107107
$result = [];
108108
foreach ($helper->getPaymentMethods() as $code => $method) {
109+
if (!isset($method['model'])) {
110+
$this->addWarning(
111+
'The `model` node must be provided for payment method configuration with code: ' . $code
112+
);
113+
continue;
114+
}
109115
$result[] = [$code, $method['model']];
110116
}
111117
return $result;

dev/tests/integration/testsuite/Magento/Test/Integrity/StaticFilesTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,14 @@ public function referencesFromLayoutFilesDataProvider()
304304
$result = [];
305305
$files = \Magento\Framework\App\Utility\Files::init()->getLayoutFiles(['with_metainfo' => true], false);
306306
foreach ($files as $metaInfo) {
307-
list($area, $themePath, , , $file) = $metaInfo;
307+
list($area, $themePath, , , $file) = array_pad($metaInfo, 5, null);
308+
309+
if (!is_string($file)) {
310+
$this->addWarning(
311+
'Wrong layout file configuration provided. The `file` meta info must be the type of string'
312+
);
313+
continue;
314+
}
308315
foreach ($this->collectFileIdsFromLayout($file) as $fileId) {
309316
$result[] = [$file, $area, $themePath, $fileId];
310317
}

0 commit comments

Comments
 (0)