File tree Expand file tree Collapse file tree 6 files changed +44
-6
lines changed
testData/actions/generation/generator/PluginDiXmlGenerator
addTwoPluginsToOneTargetClass
generatePluginDiXmlFileForAdminhtmlArea
generatePluginDiXmlFileForBaseArea
generatePluginDiXmlFileWithoutSortOrder
tests/com/magento/idea/magento2plugin/actions/generation/generator Expand file tree Collapse file tree 6 files changed +44
-6
lines changed Original file line number Diff line number Diff line change 33 xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
44 <type name =" Foo\Bar\Model\PluginTargetClassOne" >
55 <plugin name =" test_plugin_name_1"
6- type =" Foo\Bar\Plugin\TestOnePlugin" sortOrder =" 10" />
6+ type =" Foo\Bar\Plugin\TestOnePlugin"
7+ sortOrder =" 10" />
78 </type >
89 <type name =" Foo\Bar\Model\PluginTargetClassTwo" >
910 <plugin name =" test_plugin_name_2"
10- type =" Foo\Bar\Plugin\TestTwoPlugin" sortOrder =" 20" />
11+ type =" Foo\Bar\Plugin\TestTwoPlugin"
12+ sortOrder =" 20" />
1113 </type >
1214</config >
Original file line number Diff line number Diff line change 33 xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
44 <type name =" Foo\Bar\Model\PluginTargetClassOne" >
55 <plugin name =" test_plugin_name_1"
6- type =" Foo\Bar\Plugin\TestOnePlugin" sortOrder =" 10" />
6+ type =" Foo\Bar\Plugin\TestOnePlugin"
7+ sortOrder =" 10" />
78 <plugin name =" test_plugin_name_2"
8- type =" Foo\Bar\Plugin\TestTwoPlugin" sortOrder =" 20" />
9+ type =" Foo\Bar\Plugin\TestTwoPlugin"
10+ sortOrder =" 20" />
911 </type >
1012</config >
Original file line number Diff line number Diff line change 33 xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
44 <type name =" Foo\Bar\Model\PluginTargetClassTwo" >
55 <plugin name =" test_plugin_name_2"
6- type =" Foo\Bar\Plugin\TestTwoPlugin" sortOrder =" 20" />
6+ type =" Foo\Bar\Plugin\TestTwoPlugin"
7+ sortOrder =" 20" />
78 </type >
89</config >
Original file line number Diff line number Diff line change 33 xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
44 <type name =" Foo\Bar\Model\PluginTargetClassOne" >
55 <plugin name =" test_plugin_name_1"
6- type =" Foo\Bar\Plugin\TestOnePlugin" sortOrder =" 10" />
6+ type =" Foo\Bar\Plugin\TestOnePlugin"
7+ sortOrder =" 10" />
78 </type >
89</config >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4+ <type name =" Foo\Bar\Model\PluginTargetClassOne" >
5+ <plugin name =" test_plugin_name_1"
6+ type =" Foo\Bar\Plugin\TestOnePlugin" />
7+ </type >
8+ </config >
Original file line number Diff line number Diff line change @@ -25,6 +25,30 @@ public class PluginDiXmlGeneratorTest extends BaseGeneratorTestCase {
2525 private static final String MODULE = "Foo_Bar" ;
2626 private static final String MODULE_DIR = "src/app/code/Foo/Bar/" ;
2727
28+ /**
29+ * Test checks whether di.xml is generated correctly for the base area
30+ */
31+ public void testGeneratePluginDiXmlFileWithoutSortOrder () {
32+ final PsiFile expectedFile = myFixture .configureByFile (
33+ this .getFixturePath (ModuleDiXml .FILE_NAME )
34+ );
35+ final String area = Areas .base .toString ();
36+
37+ final PsiFile diXml = addPluginDiXml (
38+ PLUGIN_TARGET_CLASS_ONE_FNQ ,
39+ area ,
40+ "" ,
41+ "test_plugin_name_1" ,
42+ PLUGIN_CLASS_ONE_FNQ
43+ );
44+
45+ assertGeneratedFileIsCorrect (
46+ expectedFile ,
47+ getExpectedDirectory (area ),
48+ diXml
49+ );
50+ }
51+
2852 /**
2953 * Test checks whether di.xml is generated correctly for the base area
3054 */
You can’t perform that action at this time.
0 commit comments