Пример #1
0
 public function testMergedConfig()
 {
     $files = $this->getXmlConfigFiles();
     if (empty($files)) {
         $this->markTestSkipped('There are no xml files in the system for this test.');
     }
     // have the file resolver return all relevant xml files
     $this->_fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($this->getXmlConfigFiles()));
     try {
         // this will merge all xml files and validate them
         $this->_reader->read('global');
     } catch (\Magento\Framework\Exception\LocalizedException $e) {
         $this->fail($e->getMessage());
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function read($scope = null)
 {
     $activeModules = $this->_filterActiveModules(parent::read($scope));
     foreach ($activeModules as $moduleConfig) {
         $this->dependencyManager->checkModuleDependencies($moduleConfig, $activeModules);
     }
     return $this->_sortModules($activeModules);
 }
 /**
  * Constructor
  *
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(
     \Magento\Framework\Config\FileResolverInterface $fileResolver,
     Converter $converter,
     SchemaLocator $schemaLocator,
     \Magento\Framework\Config\ValidationStateInterface $validationState,
     $fileName = 'search_engine.xml',
     $idAttributes = [],
     $domDocumentClass = 'Magento\Framework\Config\Dom',
     $defaultScope = 'global'
 ) {
     parent::__construct(
         $fileResolver,
         $converter,
         $schemaLocator,
         $validationState,
         $fileName,
         $idAttributes,
         $domDocumentClass,
         $defaultScope
     );
 }
Пример #4
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param \Magento\Eav\Model\Entity\Attribute\Config\Converter $converter
  * @param \Magento\Eav\Model\Entity\Attribute\Config\SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @codeCoverageIgnore
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, \Magento\Eav\Model\Entity\Attribute\Config\Converter $converter, \Magento\Eav\Model\Entity\Attribute\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState)
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, 'eav_attributes.xml', []);
 }
Пример #5
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param \Magento\Framework\Object\Copy\Config\Converter $converter
  * @param \Magento\Framework\Config\SchemaLocatorInterface $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, \Magento\Framework\Object\Copy\Config\Converter $converter, \Magento\Framework\Config\SchemaLocatorInterface $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName = 'fieldset.xml', $idAttributes = array(), $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #6
0
 /**
  * Construct the FileSystem Reader Class
  *
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, Converter $converter, \Magento\Directory\Model\Country\Postcode\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName = 'zip_codes.xml', $idAttributes = [], $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #7
0
 /**
  * Constructor
  *
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param \Magento\Config\Model\Config\SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param CompilerInterface $compiler
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, Converter $converter, \Magento\Config\Model\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, CompilerInterface $compiler, $fileName = 'system.xml', $idAttributes = [], $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global')
 {
     $this->compiler = $compiler;
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #8
0
 /**
  * Read resource configuration
  *
  * @param string $scope
  * @return array
  */
 public function read($scope = null)
 {
     return $scope !== 'primary' ? parent::read($scope) : array();
 }
Пример #9
0
 /**
  * {@inheritdoc}
  */
 public function read($scope = null)
 {
     $scope = $scope ?: $this->_defaultScope;
     $result = [];
     $parents = (array) $this->_fileResolver->getParents($this->_fileName, $scope);
     // Sort parents desc
     krsort($parents);
     foreach ($parents as $parent) {
         $result = array_replace_recursive($result, $this->_readFiles([$parent]));
     }
     return array_replace_recursive($result, parent::read($scope));
 }
Пример #10
0
 /**
  * @expectedException \UnexpectedValueException
  * @expectedExceptionMessage Instance of the DOM config merger is expected, got StdClass instead.
  */
 public function testReadException()
 {
     $this->_fileResolverMock->expects($this->once())->method('get')->will($this->returnValue([$this->_file]));
     $model = new Filesystem(
         $this->_fileResolverMock,
         $this->_converterMock,
         $this->_schemaLocatorMock,
         $this->_validationStateMock,
         'fileName',
         [],
         'StdClass'
     );
     $model->read();
 }
Пример #11
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, Converter $converter, SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName = 'routes.xml')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $this->_idAttributes);
 }
Пример #12
0
 /**
  * Constructor
  *
  * @param FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param SchemaLocatorInterface $schemaLocator
  * @param ValidationStateInterface $validationState
  * @param Backend $helper
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(FileResolverInterface $fileResolver, Converter $converter, SchemaLocatorInterface $schemaLocator, ValidationStateInterface $validationState, Backend $helper, $fileName = 'adminhtml/rules/payment_{country}.xml', $idAttributes = [], $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'primary')
 {
     $fileName = str_replace('{country}', strtolower($helper->getConfigurationCountryCode()), $fileName);
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #13
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param \Magento\Framework\ObjectManager\Config\Mapper\Dom $converter
  * @param \Magento\Framework\ObjectManager\Config\SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, \Magento\Framework\ObjectManager\Config\Mapper\Dom $converter, \Magento\Framework\ObjectManager\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName = 'di.xml', $idAttributes = [], $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #14
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, Converter $converter, SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState)
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, 'address_formats.xml', array('/config/format' => 'code'));
 }
Пример #15
0
 /**
  * @param FileResolverInterface $fileResolver
  * @param Converter $converter
  * @param SchemaLocator $schemaLocator
  * @param ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(FileResolverInterface $fileResolver, Converter $converter, SchemaLocator $schemaLocator, ValidationStateInterface $validationState, $fileName = 'email_templates.xml', $idAttributes = array(), $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #16
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param \Magento\Cron\Model\Groups\Config\Converter\Xml $converter
  * @param \Magento\Cron\Model\Groups\Config\SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, \Magento\Cron\Model\Groups\Config\Converter\Xml $converter, \Magento\Cron\Model\Groups\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName = 'cron_groups.xml', $idAttributes = array(), $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #17
0
 /**
  * @param FileResolverInterface $fileResolver
  * @param ConverterInterface $converter
  * @param SchemaLocatorInterface $schemaLocator
  * @param ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  * @param array $xpath
  */
 public function __construct(FileResolverInterface $fileResolver, ConverterInterface $converter, SchemaLocatorInterface $schemaLocator, ValidationStateInterface $validationState, $fileName, $idAttributes = [], $domDocumentClass = 'Magento\\Framework\\Config\\Dom', $defaultScope = 'global', $xpath = [])
 {
     $this->xpath = $xpath;
     $idAttributes = $this->getIdAttributes();
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #18
0
 /**
  * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  * @param \Magento\Backend\Model\Menu\Config\Converter $converter
  * @param \Magento\Backend\Model\Menu\Config\SchemaLocator $schemaLocator
  * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  * @param string $fileName
  * @param array $idAttributes
  * @param string $domDocumentClass
  * @param string $defaultScope
  */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, \Magento\Backend\Model\Menu\Config\Converter $converter, \Magento\Backend\Model\Menu\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName = 'menu.xml', $idAttributes = [], $domDocumentClass = 'Magento\\Backend\\Model\\Menu\\Config\\Menu\\Dom', $defaultScope = 'global')
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }
Пример #19
0
 /**
 * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
 * @param \Magento\Catalog\Model\ProductOptions\Config\Converter $converter
 * @param \Magento\Catalog\Model\ProductOptions\Config\SchemaLocator
 $schemaLocator
 * @param \Magento\Framework\Config\ValidationStateInterface $validationState
 * @param string $fileName
 * @param array $idAttributes
 * @param string $domDocumentClass
 * @param string $defaultScope
 */
 public function __construct(\Magento\Framework\Config\FileResolverInterface $fileResolver, \Ktpl\Test\Model\Config\Converter $converter, \Ktpl\Test\Model\Config\SchemaLocator $schemaLocator, \Magento\Framework\Config\ValidationStateInterface $validationState, $fileName, $domDocumentClass, $defaultScope, $idAttributes)
 {
     parent::__construct($fileResolver, $converter, $schemaLocator, $validationState, $fileName, $idAttributes, $domDocumentClass, $defaultScope);
 }