Skip to content

Commit 58bf206

Browse files
committed
MAGETWO-38686: Merge and Fix Builds
- fixed web-api tests
1 parent 0552334 commit 58bf206

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ class Application
122122
*/
123123
private $globalConfigFile;
124124

125+
/**
126+
* Defines whether load test extension attributes or not
127+
*
128+
* @var bool
129+
*/
130+
private $loadTestExtensionAttributes;
131+
125132
/**
126133
* Constructor
127134
*
@@ -132,6 +139,7 @@ class Application
132139
* @param string $globalConfigDir
133140
* @param string $appMode
134141
* @param AutoloaderInterface $autoloadWrapper
142+
* @param bool|null $loadTestExtensionAttributes
135143
*/
136144
public function __construct(
137145
\Magento\Framework\Shell $shell,
@@ -140,13 +148,15 @@ public function __construct(
140148
$globalConfigFile,
141149
$globalConfigDir,
142150
$appMode,
143-
AutoloaderInterface $autoloadWrapper
151+
AutoloaderInterface $autoloadWrapper,
152+
$loadTestExtensionAttributes = false
144153
) {
145154
$this->_shell = $shell;
146155
$this->installConfigFile = $installConfigFile;
147156
$this->_globalConfigDir = realpath($globalConfigDir);
148157
$this->_appMode = $appMode;
149158
$this->installDir = $installDir;
159+
$this->loadTestExtensionAttributes = $loadTestExtensionAttributes;
150160

151161
$customDirs = $this->getCustomDirs();
152162
$this->dirList = new \Magento\Framework\App\Filesystem\DirectoryList(BP, $customDirs);
@@ -267,10 +277,9 @@ public function isInstalled()
267277
* Initialize application
268278
*
269279
* @param array $overriddenParams
270-
* @param bool $loadTestExtensionAttributes
271280
* @return void
272281
*/
273-
public function initialize($overriddenParams = [], $loadTestExtensionAttributes = false)
282+
public function initialize($overriddenParams = [])
274283
{
275284
$overriddenParams[\Magento\Framework\App\State::PARAM_MODE] = $this->_appMode;
276285
$overriddenParams = $this->_customizeParams($overriddenParams);
@@ -332,7 +341,7 @@ public function initialize($overriddenParams = [], $loadTestExtensionAttributes
332341
=> 'Magento\TestFramework\Mail\Template\TransportBuilderMock',
333342
]
334343
];
335-
if ($loadTestExtensionAttributes) {
344+
if ($this->loadTestExtensionAttributes) {
336345
$objectManagerConfiguration = array_merge(
337346
$objectManagerConfiguration,
338347
[
@@ -382,7 +391,7 @@ public function initialize($overriddenParams = [], $loadTestExtensionAttributes
382391
public function reinitialize(array $overriddenParams = [])
383392
{
384393
$this->_resetApp();
385-
$this->initialize($overriddenParams, true);
394+
$this->initialize($overriddenParams);
386395
}
387396

388397
/**

dev/tests/integration/framework/bootstrap.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
$globalConfigFile,
5353
$settings->get('TESTS_GLOBAL_CONFIG_DIR'),
5454
$settings->get('TESTS_MAGENTO_MODE'),
55-
AutoloaderRegistry::getAutoloader()
55+
AutoloaderRegistry::getAutoloader(),
56+
true
5657
);
5758

5859
$bootstrap = new \Magento\TestFramework\Bootstrap(
@@ -71,7 +72,7 @@
7172
if (!$application->isInstalled()) {
7273
$application->install();
7374
}
74-
$application->initialize([], true);
75+
$application->initialize([]);
7576

7677
\Magento\TestFramework\Helper\Bootstrap::setInstance(new \Magento\TestFramework\Helper\Bootstrap($bootstrap));
7778

0 commit comments

Comments
 (0)