Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PluginScannerTest.php
Go to the documentation of this file.
1 <?php
8 
9 class PluginScannerTest extends \PHPUnit\Framework\TestCase
10 {
11  protected function setUp()
12  {
13  $this->_model = new \Magento\Setup\Module\Di\Code\Scanner\PluginScanner();
14  $this->_testDir = str_replace('\\', '/', realpath(__DIR__ . '/../../') . '/_files');
15  $this->_testFiles = [
16  $this->_testDir . '/app/code/Magento/SomeModule/etc/di.xml',
17  $this->_testDir . '/app/etc/di/config.xml',
18  ];
19  }
20 
21  protected function tearDown()
22  {
23  unset($this->_model);
24  }
25 
26  public function testCollectEntities()
27  {
28  $actual = $this->_model->collectEntities($this->_testFiles);
29  $expected = [\Magento\Framework\App\Cache\TagPlugin::class, \Magento\Store\Model\Action\Plugin::class];
30  $this->assertEquals($expected, $actual);
31  }
32 }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60