Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
AclConfigFilesTest.php
Go to the documentation of this file.
1 <?php
7 
8 class AclConfigFilesTest extends \PHPUnit\Framework\TestCase
9 {
15  protected $_fileList = [];
16 
22  protected $_schemeFile;
23 
24  protected function setUp()
25  {
26  $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
27  $this->_schemeFile = $urnResolver->getRealPath('urn:magento:framework:Acl/etc/acl.xsd');
28  }
29 
35  public function testAclConfigFile($file)
36  {
37  $validationStateMock = $this->createMock(\Magento\Framework\Config\ValidationStateInterface::class);
38  $validationStateMock->method('isValidationRequired')
39  ->willReturn(true);
40  $domConfig = new \Magento\Framework\Config\Dom(file_get_contents($file), $validationStateMock);
41  $result = $domConfig->validate($this->_schemeFile, $errors);
42  $message = "Invalid XML-file: {$file}\n";
43  foreach ($errors as $error) {
44  $message .= "{$error}\n";
45  }
46  $this->assertTrue($result, $message);
47  }
48 
52  public function aclConfigFileDataProvider()
53  {
54  return \Magento\Framework\App\Utility\Files::init()->getConfigFiles('acl.xml');
55  }
56 }
$message
$errors
Definition: overview.phtml:9