Skip to content

Commit 9342d4c

Browse files
author
oleksandrkravchuk
committed
community-features#252 Create static test for action controllers.
Fix static tests.
1 parent 7181dbc commit 9342d4c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

dev/tests/static/testsuite/Magento/Test/Legacy/Magento/App/Action/AbstractActionTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\Test\Legacy\App\Action;
8+
namespace Magento\Test\Legacy\Magento\App\Action;
99

1010
use Exception;
1111
use Magento\Framework\App\Action\AbstractAction;
@@ -41,9 +41,8 @@ protected function setUp(): void
4141
}
4242

4343
/**
44-
* Test new
45-
*
46-
*/
44+
* Test newly created controllers do not extend deprecated AbstractAction.
45+
*/
4746
public function testNewControllersDoNotExtendAbstractAction(): void
4847
{
4948
$files = $this->getTestFiles();
@@ -121,25 +120,21 @@ private static function getFilesFromListFile(
121120
callable $noListCallback
122121
): array {
123122
$filesDefinedInList = [];
124-
125123
$listFiles = glob($listsBaseDir . '/_files/' . $listFilePattern);
126124
if (!empty($listFiles)) {
127125
foreach ($listFiles as $listFile) {
128126
$filesDefinedInList[] = file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
129127
}
130-
131-
$filesDefinedInList = array_merge([], ...$filesDefinedInList);
128+
$filesDefinedInList = array_merge([], ...$filesDefinedInList);
132129
} else {
133130
$filesDefinedInList = call_user_func($noListCallback);
134131
}
135-
136132
array_walk(
137133
$filesDefinedInList,
138134
function (&$file) {
139135
$file = BP . '/' . $file;
140136
}
141137
);
142-
143138
$filesDefinedInList = array_values(array_unique($filesDefinedInList));
144139

145140
return $filesDefinedInList;

0 commit comments

Comments
 (0)