File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Framework/ObjectManager Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,30 @@ public function assertObsoleteFormat($file)
50
50
'The <value> node is obsolete. Instead, provide the actual value as a text literal. '
51
51
);
52
52
}
53
+
54
+ public function testCommandListClassIsNotDirectlyConfigured ()
55
+ {
56
+ $ invoker = new \Magento \Framework \App \Utility \AggregateInvoker ($ this );
57
+ $ invoker (
58
+ [$ this , 'assertCommandListClassIsNotDirectlyConfigured ' ],
59
+ \Magento \Framework \App \Utility \Files::init ()->getDiConfigs (true )
60
+ );
61
+ }
62
+
63
+ /**
64
+ * Scan the specified di.xml file and assert that it has no directly configured CommandList class
65
+ *
66
+ * @param string $file
67
+ */
68
+ public function assertCommandListClassIsNotDirectlyConfigured ($ file )
69
+ {
70
+ $ xml = simplexml_load_file ($ file );
71
+ foreach ($ xml ->xpath ('//type ' ) as $ type ) {
72
+ $ this ->assertNotContains (
73
+ 'Magento\Framework\Console\CommandList ' ,
74
+ $ type ->attributes (),
75
+ 'Use \Magento\Framework\Console\CommandListInterface instead of \Magento\Framework\Console\CommandList '
76
+ );
77
+ }
78
+ }
53
79
}
You can’t perform that action at this time.
0 commit comments