ObsoleteSystemConfigurationTest.php 900 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Legacy tests to find obsolete system configuration declaration
  8. */
  9. namespace Magento\Test\Legacy;
  10. class ObsoleteSystemConfigurationTest extends \PHPUnit\Framework\TestCase
  11. {
  12. public function testSystemConfigurationDeclaration()
  13. {
  14. $fileList = \Magento\Framework\App\Utility\Files::init()->getConfigFiles(
  15. 'system.xml',
  16. ['wsdl.xml', 'wsdl2.xml', 'wsi.xml'],
  17. false
  18. );
  19. foreach ($fileList as $configFile) {
  20. $configXml = simplexml_load_file($configFile);
  21. $xpath = '/config/tabs|/config/sections';
  22. $this->assertEmpty(
  23. $configXml->xpath($xpath),
  24. 'Obsolete system configuration structure detected in file ' . $configFile . '.'
  25. );
  26. }
  27. }
  28. }