Skip to content

Commit 4fbc5eb

Browse files
author
Dmytro Aponasenko
committed
MTA-1355: Update tests with configuration fixture
1 parent 5f7e1d3 commit 4fbc5eb

File tree

6 files changed

+7
-32
lines changed

6 files changed

+7
-32
lines changed

dev/tests/functional/lib/Mtf/ObjectManagerFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ public function create(array $sharedInstances = [])
5252
$diConfig = new $this->configClassName();
5353
$systemConfig = new SystemConfig();
5454
$configuration = $systemConfig->getConfigParam();
55-
$diConfig->extend($configuration);
55+
$diConfig->extend((array)$configuration);
5656
$factory = new Factory($diConfig);
5757
$argInterpreter = $this->createArgumentInterpreter(new BooleanUtils());
5858
$argumentMapper = new \Magento\Framework\ObjectManager\Config\Mapper\Dom($argInterpreter);
5959

60+
$sharedInstances['Magento\Framework\Data\Argument\InterpreterInterface'] = $argInterpreter;
6061
$sharedInstances['Magento\Framework\ObjectManager\Config\Mapper\Dom'] = $argumentMapper;
6162
$objectManager = new $this->locatorClassName($factory, $diConfig, $sharedInstances);
6263

dev/tests/functional/lib/Mtf/Util/Generate/Fixture/FieldsProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function checkConnection()
5050
{
5151
$this->connection = $this->getConnection('core_write');
5252
if (!$this->connection || $this->connection instanceof \Zend_Db_Adapter_Exception) {
53-
echo ('Connection to Magento 2 database is absent.' . PHP_EOL);
53+
echo ('Connection to Magento 2 database is absent. Fixture data has not been fetched.' . PHP_EOL);
5454
return false;
5555
}
5656

dev/tests/functional/lib/Mtf/Util/Generate/Repository/CollectionProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function checkConnection()
4545
{
4646
$connection = $this->getConnection('read');
4747
if (!$connection || $connection instanceof \Zend_Db_Adapter_Exception) {
48-
echo ('Connection to Magento 2 database is absent.' . PHP_EOL);
48+
echo ('Connection to Magento 2 database is absent. Repository data has not been fetched.' . PHP_EOL);
4949
return false;
5050
}
5151

dev/tests/functional/tests/app/Magento/Sales/Test/etc/fixture.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66
*/
77
-->
88
<fixture>
9-
<order module="Magento_Sales">
10-
<type>flat</type>
11-
<entity_type>sales_order</entity_type>
12-
<collection>Magento\Sales\Model\Resource\Order\Collection</collection>
13-
<fields>
14-
<id>
15-
<attribute_code>id</attribute_code>
16-
<backend_type>virtual</backend_type>
17-
</id>
18-
</fields>
19-
</order>
209
<orderInjectable module="Magento_Sales">
2110
<type>flat</type>
2211
<entity_type>sales_order</entity_type>

dev/tests/functional/utils/generate.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
*/
66
require_once dirname(__FILE__) . '/' . 'bootstrap.php';
77

8-
$objectManager->create('Mtf\Util\Generate\TestCase')->launch();
98
$objectManager->create('Mtf\Util\Generate\Page')->launch();
109
$objectManager->create('Mtf\Util\Generate\Fixture')->launch();
11-
$objectManager->create('Mtf\Util\Generate\Constraint')->launch();
12-
$objectManager->create('Mtf\Util\Generate\Handler')->launch();
13-
1410
$objectManager->get('Magento\Framework\App\State')->setAreaCode('frontend');
1511
$objectManager->create('Mtf\Util\Generate\Repository')->launch();
12+
$objectManager->create('Mtf\Util\Generate\Factory')->launch();
1613

1714
\Mtf\Util\Generate\GenerateResult::displayResults();

dev/tests/functional/utils/generate/factory.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
$mtfRoot = dirname(dirname(dirname(__FILE__)));
8-
$mtfRoot = str_replace('\\', '/', $mtfRoot);
9-
define('MTF_BP', $mtfRoot);
10-
define('MTF_TESTS_PATH', MTF_BP . '/tests/app/');
11-
12-
require __DIR__ . '/../../../../../app/bootstrap.php';
13-
require MTF_BP . '/vendor/autoload.php';
14-
15-
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
16-
17-
$om = $bootstrap->getObjectManager();
18-
/** @var \Mtf\Util\Generate\Factory $generator */
19-
$generator = $om->create('Mtf\Util\Generate\Factory');
20-
$generator->launch();
7+
require_once dirname(__DIR__) . '/' . 'bootstrap.php';
8+
$objectManager->create('Mtf\Util\Generate\Factory')->launch();
219
\Mtf\Util\Generate\GenerateResult::displayResults();

0 commit comments

Comments
 (0)