-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathRoot.php
41 lines (35 loc) · 1.39 KB
/
Root.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\FunctionalTestingFramework\Config\FileResolver;
use Magento\FunctionalTestingFramework\Config\FileResolverInterface;
use Magento\FunctionalTestingFramework\Util\Iterator\File;
class Root extends Module
{
const ROOT_SUITE_DIR = "tests/_suite";
/**
* Retrieve the list of configuration files with given name that relate to specified scope at the root level as well
* as any extension based suite configuration.
*
* @param string $filename
* @param string $scope
* @return array|\Iterator,\Countable
*/
public function get($filename, $scope)
{
// first pick up the root level test suite dir
$paths = glob(
TESTS_BP . DIRECTORY_SEPARATOR . self::ROOT_SUITE_DIR
. DIRECTORY_SEPARATOR . $filename
);
// then merge this path into the module based paths
// Since we are sharing this code with Module based resolution we will unncessarily glob against modules in the
// dev/tests dir tree, however as we plan to migrate to app/code this will be a temporary unneeded check.
$paths = array_merge($paths, $this->getPaths($filename, $scope));
// create and return the iterator for these file paths
$iterator = new File($paths);
return $iterator;
}
}