Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ObsoleteMenuTest.php
Go to the documentation of this file.
1 <?php
10 namespace Magento\Test\Legacy;
11 
12 class ObsoleteMenuTest extends \PHPUnit\Framework\TestCase
13 {
14  public function testMenuDeclaration()
15  {
16  $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
17  $invoker(
21  function ($menuFile) {
22  $menuXml = simplexml_load_file($menuFile);
23  $xpath = '/config/menu/*[boolean(./children) or boolean(./title) or boolean(./action)]';
24  $this->assertEmpty(
25  $menuXml->xpath($xpath),
26  'Obsolete menu structure detected in file ' . $menuFile . '.'
27  );
28  },
29  \Magento\Framework\App\Utility\Files::init()->getMainConfigFiles()
30  );
31  }
32 }