Skip to content

Commit 5c449a4

Browse files
author
Sergii Kovalenko
committed
MAGETWO-87190: Test coverage for critical logic
1 parent 13e8b3c commit 5c449a4

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeSchemaBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DeclarativeSchemaBuilderTest extends SetupTestCase
3838
public function setUp()
3939
{
4040
$objectManager = Bootstrap::getObjectManager();
41-
$this->schemaConfig = $objectManager->create(SchemaConfig::class);
41+
$this->schemaConfig = $objectManager->get(SchemaConfig::class);
4242
$this->moduleManager = $objectManager->get(TestModuleManager::class);
4343
$this->cliCommad = $objectManager->get(CliCommand::class);
4444
}

setup/src/Magento/Setup/Model/Declaration/Schema/Declaration/ReaderComposite.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Setup\Model\Declaration\Schema\Declaration;
88

9+
use Magento\Framework\App\DeploymentConfig;
910
use Magento\Framework\Config\ReaderInterface;
1011

1112
/**
@@ -20,14 +21,21 @@ class ReaderComposite implements ReaderInterface
2021
*/
2122
private $readers;
2223

24+
/**
25+
* @var DeploymentConfig
26+
*/
27+
private $deploymentConfig;
28+
2329
/**
2430
* Constructor.
2531
*
32+
* @param DeploymentConfig $deploymentConfig
2633
* @param ReaderInterface[] $readers
2734
*/
28-
public function __construct(array $readers = [])
35+
public function __construct(DeploymentConfig $deploymentConfig, array $readers = [])
2936
{
3037
$this->readers = $readers;
38+
$this->deploymentConfig = $deploymentConfig;
3139
}
3240

3341
/**
@@ -39,7 +47,12 @@ public function read($scope = null)
3947
foreach ($this->readers as $reader) {
4048
$schema = array_replace_recursive($schema, $reader->read($scope));
4149
}
42-
var_dump($schema);
50+
51+
if (!count($schema)) {
52+
var_dump($this->deploymentConfig->get());
53+
var_dump($this->deploymentConfig->getConfigData());
54+
}
55+
4356
return $schema;
4457
}
4558
}

0 commit comments

Comments
 (0)