forked from magento/magento2-functional-testing-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSchemaLocator.php
56 lines (52 loc) · 1.25 KB
/
SchemaLocator.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\FunctionalTestingFramework\Config;
/**
* Class SchemaLocator
* Scenario configuration schema locator
*/
class SchemaLocator implements \Magento\FunctionalTestingFramework\Config\SchemaLocatorInterface
{
/**
* XSD schema path
*
* @var string
*/
protected $schemaPath;
/**
* Class constructor
*
* @param string $schemaPath
*/
public function __construct($schemaPath)
{
if (constant('FW_BP') && file_exists(FW_BP . DIRECTORY_SEPARATOR . $schemaPath)) {
$this->schemaPath = FW_BP . DIRECTORY_SEPARATOR . $schemaPath;
} else {
$path = dirname(dirname(dirname(__DIR__)));
$path = str_replace('\\', DIRECTORY_SEPARATOR, $path);
$this->schemaPath = $path . DIRECTORY_SEPARATOR . $schemaPath;
}
}
/**
* Get path to merged config schema
*
* @return string
*/
public function getSchema()
{
return $this->schemaPath;
}
/**
* Get path to pre file validation schema
*
* @return null
*/
public function getPerFileSchema()
{
return null;
}
}