-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathDom.php
70 lines (67 loc) · 2.5 KB
/
Dom.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\FunctionalTestingFramework\ObjectManager\Config\Reader;
/**
* Class Dom
*
* @internal
*/
// @codingStandardsIgnoreFile
class Dom extends \Magento\FunctionalTestingFramework\Config\Reader\Filesystem
{
/**
* Name of an attribute that stands for data type of node values
*/
const TYPE_ATTRIBUTE = 'xsi:type';
/**
* Dom constructor.
* @param \Magento\FunctionalTestingFramework\Config\FileResolverInterface $fileResolver
* @param \Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\Dom $converter
* @param \Magento\FunctionalTestingFramework\ObjectManager\Config\SchemaLocator $schemaLocator
* @param \Magento\FunctionalTestingFramework\Config\ValidationStateInterface $validationState
* @param string $fileName
* @param array $idAttributes
* @param string $domDocumentClass
* @param string $defaultScope
*/
public function __construct(
\Magento\FunctionalTestingFramework\Config\FileResolverInterface $fileResolver,
\Magento\FunctionalTestingFramework\ObjectManager\Config\Mapper\Dom $converter,
\Magento\FunctionalTestingFramework\ObjectManager\Config\SchemaLocator $schemaLocator,
\Magento\FunctionalTestingFramework\Config\ValidationStateInterface $validationState,
$fileName = 'di.xml',
$idAttributes = [
'/config/preference' => 'for',
'/config/(type|virtualType)' => 'name',
'/config/(type|virtualType)/arguments/argument' => 'name',
'/config/(type|virtualType)/arguments/argument(/item)+' => 'name'
],
$domDocumentClass = 'Magento\FunctionalTestingFramework\Config\Dom',
$defaultScope = 'etc'
) {
parent::__construct(
$fileResolver,
$converter,
$schemaLocator,
$validationState,
$fileName,
$idAttributes,
$domDocumentClass,
$defaultScope
);
}
/**
* Create and return a config merger instance that takes into account types of arguments
*
* @param string $mergerClass
* @param string $initialContents
* @return \Magento\FunctionalTestingFramework\Config\Dom
*/
protected function _createConfigMerger($mergerClass, $initialContents)
{
return new $mergerClass($initialContents, $this->idAttributes, self::TYPE_ATTRIBUTE, $this->perFileSchema);
}
}