Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
XmlInterceptorScannerTest.php
Go to the documentation of this file.
1 <?php
7 
8 class XmlInterceptorScannerTest extends \PHPUnit\Framework\TestCase
9 {
13  protected $_model;
14 
18  protected $_testDir;
19 
23  protected $_testFiles = [];
24 
25  protected function setUp()
26  {
27  $this->_model = new \Magento\Setup\Module\Di\Code\Scanner\XmlInterceptorScanner();
28  $this->_testDir = str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/_files');
29  $this->_testFiles = [
30  $this->_testDir . '/app/code/Magento/SomeModule/etc/di.xml',
31  $this->_testDir . '/app/etc/di/config.xml',
32  ];
33  }
34 
35  public function testCollectEntities()
36  {
37  $actual = $this->_model->collectEntities($this->_testFiles);
38  $expected = [
39  \Magento\Framework\App\Cache\Interceptor::class,
40  \Magento\Framework\App\Action\Context\Interceptor::class,
41  ];
42  $this->assertEquals($expected, $actual);
43  }
44 }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60