Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CarrierConfigFilesTest.php
Go to the documentation of this file.
1 <?php
9 
11 
12 class CarrierConfigFilesTest extends \PHPUnit\Framework\TestCase
13 {
17  protected $_reader;
18 
19  protected function setUp()
20  {
21  $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
22  $schemaFile = $urnResolver->getRealPath('urn:magento:module:Magento_Config:etc/system.xsd');
24  \Magento\Config\Model\Config\Structure\Reader::class,
25  ['perFileSchema' => $schemaFile, 'isValidated' => true]
26  );
27  }
28 
33  {
34  $config = $this->_reader->read('adminhtml');
35 
36  $carriers = $config['config']['system']['sections']['carriers']['children'];
37  foreach ($carriers as $carrier) {
38  foreach ($carrier['children'] as $field) {
39  if (isset($field['source_model'])) {
40  $model = $field['source_model'];
42  }
43  }
44  }
45  }
46 }
$config
Definition: fraud_order.php:17