getRealPath('urn:magento:module:Magento_Config:etc/system.xsd'); $this->_reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( \Magento\Config\Model\Config\Structure\Reader::class, ['perFileSchema' => $schemaFile, 'isValidated' => true] ); } /** * Tests that all source_models used in shipping are valid */ public function testValidateShippingSourceModels() { $config = $this->_reader->read('adminhtml'); $carriers = $config['config']['system']['sections']['carriers']['children']; foreach ($carriers as $carrier) { foreach ($carrier['children'] as $field) { if (isset($field['source_model'])) { $model = $field['source_model']; \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create($model); } } } } }