@@ -62,6 +62,11 @@ class CompilerTest extends \PHPUnit\Framework\TestCase
62
62
*/
63
63
protected $ pluginValidator ;
64
64
65
+ /**
66
+ * @var string[]|null
67
+ */
68
+ private $ pluginBlacklist ;
69
+
65
70
protected function setUp ()
66
71
{
67
72
$ this ->_shell = new \Magento \Framework \Shell (new \Magento \Framework \Shell \CommandRenderer ());
@@ -107,6 +112,31 @@ protected function setUp()
107
112
$ this ->pluginValidator = new PluginValidator (new InterfaceValidator ());
108
113
}
109
114
115
+ /**
116
+ * Return plugin blacklist class names
117
+ *
118
+ * @return string[]
119
+ */
120
+ private function getPluginBlacklist (): array
121
+ {
122
+ if ($ this ->pluginBlacklist === null ) {
123
+ $ blacklistFiles = str_replace (
124
+ '\\' ,
125
+ '/ ' ,
126
+ realpath (__DIR__ ) . '/../_files/blacklist/compiler_plugins*.txt '
127
+ );
128
+ $ blacklistItems = [];
129
+ foreach (glob ($ blacklistFiles ) as $ fileName ) {
130
+ $ blacklistItems = array_merge (
131
+ $ blacklistItems ,
132
+ file ($ fileName , FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES )
133
+ );
134
+ }
135
+ $ this ->pluginBlacklist = $ blacklistItems ;
136
+ }
137
+ return $ this ->pluginBlacklist ;
138
+ }
139
+
110
140
/**
111
141
* Validate DI config file
112
142
*
@@ -360,6 +390,7 @@ protected function validatePlugins($plugin, $type)
360
390
* Get application plugins
361
391
*
362
392
* @return array
393
+ * @throws \Exception
363
394
*/
364
395
protected function pluginDataProvider ()
365
396
{
@@ -376,8 +407,10 @@ protected function pluginDataProvider()
376
407
$ type = \Magento \Framework \App \Utility \Classes::resolveVirtualType ($ type );
377
408
if ($ node ->attributes ->getNamedItem ('type ' )) {
378
409
$ plugin = $ node ->attributes ->getNamedItem ('type ' )->nodeValue ;
379
- $ plugin = \Magento \Framework \App \Utility \Classes::resolveVirtualType ($ plugin );
380
- $ plugins [] = ['plugin ' => $ plugin , 'intercepted type ' => $ type ];
410
+ if (!in_array ($ plugin , $ this ->getPluginBlacklist ())) {
411
+ $ plugin = \Magento \Framework \App \Utility \Classes::resolveVirtualType ($ plugin );
412
+ $ plugins [] = ['plugin ' => $ plugin , 'intercepted type ' => $ type ];
413
+ }
381
414
}
382
415
}
383
416
}
0 commit comments