Skip to content

Commit 9283a56

Browse files
author
Igor Melnikov
authored
Merge pull request #161 from magento-architects/ECP-513-stabilization
ECP-513: Static tests fixes for Catalog Storefront
2 parents 03d0961 + 5f13fd2 commit 9283a56

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,12 @@ public function __construct(
168168
$loadTestExtensionAttributes = false
169169
) {
170170
if (getcwd() != BP . '/dev/tests/integration') {
171+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
171172
chdir(BP . '/dev/tests/integration');
172173
}
173174
$this->_shell = $shell;
174175
$this->installConfigFile = $installConfigFile;
176+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
175177
$this->_globalConfigDir = realpath($globalConfigDir);
176178
$this->_appMode = $appMode;
177179
$this->installDir = $installDir;
@@ -251,6 +253,7 @@ public function getDbInstance()
251253
protected function getInstallConfig()
252254
{
253255
if (null === $this->installConfig) {
256+
// phpcs:ignore Magento2.Security.IncludeFile
254257
$this->installConfig = include $this->installConfigFile;
255258
}
256259
return $this->installConfig;
@@ -293,6 +296,7 @@ public function getInitParams()
293296
*/
294297
public function isInstalled()
295298
{
299+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
296300
return is_file($this->getLocalConfig());
297301
}
298302

@@ -426,6 +430,8 @@ public function initialize($overriddenParams = [])
426430

427431
/**
428432
* Create dynamic tables
433+
*
434+
* @return void
429435
*/
430436
protected function createDynamicTables()
431437
{
@@ -562,8 +568,10 @@ private function copyAppConfigFiles()
562568
);
563569
foreach ($globalConfigFiles as $file) {
564570
$targetFile = $this->_configDir . str_replace($this->_globalConfigDir, '', $file);
571+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
565572
$this->_ensureDirExists(dirname($targetFile));
566573
if ($file !== $targetFile) {
574+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
567575
copy($file, $targetFile);
568576
}
569577
}
@@ -577,6 +585,7 @@ private function copyAppConfigFiles()
577585
private function copyGlobalConfigFile()
578586
{
579587
$targetFile = $this->_configDir . '/config.local.php';
588+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
580589
copy($this->globalConfigFile, $targetFile);
581590
}
582591

@@ -646,10 +655,13 @@ protected function _resetApp()
646655
*/
647656
protected function _ensureDirExists($dir)
648657
{
658+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
649659
if (!file_exists($dir)) {
650660
$old = umask(0);
661+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
651662
mkdir($dir, 0777, true);
652663
umask($old);
664+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
653665
} elseif (!is_dir($dir)) {
654666
throw new \Magento\Framework\Exception\LocalizedException(__("'%1' is not a directory.", $dir));
655667
}

dev/tests/setup-integration/framework/Magento/TestFramework/SetupApplication.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ class SetupApplication extends Application
3232
*/
3333
public function run()
3434
{
35+
// phpcs:ignore Magento2.Exceptions.DirectThrow
3536
throw new \Exception("Can't start application.");
3637
}
3738

3839
/**
3940
* Create dynamic tables
4041
*
41-
* phpcs:ignore Generic.CodeAnalysis.EmptyStatement
42+
* @return null
4243
*/
4344
protected function createDynamicTables()
4445
{
46+
return null;
4547
}
4648
}

0 commit comments

Comments
 (0)