Skip to content

Commit 29e3f33

Browse files
committed
magento#12574: ConfigurationTest fails when installing via composer
1 parent a39e37f commit 29e3f33

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

dev/tests/integration/testsuite/Magento/Ui/Component/ConfigurationTest.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function setUp()
6666

6767
/** @var Filesystem $filesystem */
6868
$filesystem = $objectManager->create(Filesystem::class);
69-
$this->appDir = $filesystem->getDirectoryRead(DirectoryList::APP);
69+
$this->appDir = $this->isComposerBuilt()
70+
? $filesystem->getDirectoryRead(DirectoryList::ROOT)
71+
: $filesystem->getDirectoryRead(DirectoryList::APP);
7072
}
7173

7274
/**
@@ -249,4 +251,20 @@ private function getDom($content = null)
249251
}
250252
return $this->dom;
251253
}
254+
255+
/**
256+
* Check magento modules is in app/code.
257+
*
258+
* @return bool
259+
*/
260+
private function isComposerBuilt()
261+
{
262+
$result = false;
263+
$rootJson = json_decode(file_get_contents(BP . '/composer.json'), true);
264+
if (preg_match('/magento\/project-*/', $rootJson['name']) == 1) {
265+
$result = true;
266+
}
267+
268+
return $result;
269+
}
252270
}

0 commit comments

Comments
 (0)