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 3
3
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4
4
<type name =" Foo\Bar\Model\PluginTargetClassOne" >
5
5
<plugin name =" test_plugin_name_1"
6
- type =" Foo\Bar\Plugin\TestOnePlugin" sortOrder =" 10" />
6
+ type =" Foo\Bar\Plugin\TestOnePlugin"
7
+ sortOrder =" 10" />
7
8
</type >
8
9
<type name =" Foo\Bar\Model\PluginTargetClassTwo" >
9
10
<plugin name =" test_plugin_name_2"
10
- type =" Foo\Bar\Plugin\TestTwoPlugin" sortOrder =" 20" />
11
+ type =" Foo\Bar\Plugin\TestTwoPlugin"
12
+ sortOrder =" 20" />
11
13
</type >
12
14
</config >
Original file line number Diff line number Diff line change 3
3
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4
4
<type name =" Foo\Bar\Model\PluginTargetClassOne" >
5
5
<plugin name =" test_plugin_name_1"
6
- type =" Foo\Bar\Plugin\TestOnePlugin" sortOrder =" 10" />
6
+ type =" Foo\Bar\Plugin\TestOnePlugin"
7
+ sortOrder =" 10" />
7
8
<plugin name =" test_plugin_name_2"
8
- type =" Foo\Bar\Plugin\TestTwoPlugin" sortOrder =" 20" />
9
+ type =" Foo\Bar\Plugin\TestTwoPlugin"
10
+ sortOrder =" 20" />
9
11
</type >
10
12
</config >
Original file line number Diff line number Diff line change 3
3
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4
4
<type name =" Foo\Bar\Model\PluginTargetClassTwo" >
5
5
<plugin name =" test_plugin_name_2"
6
- type =" Foo\Bar\Plugin\TestTwoPlugin" sortOrder =" 20" />
6
+ type =" Foo\Bar\Plugin\TestTwoPlugin"
7
+ sortOrder =" 20" />
7
8
</type >
8
9
</config >
Original file line number Diff line number Diff line change 3
3
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4
4
<type name =" Foo\Bar\Model\PluginTargetClassOne" >
5
5
<plugin name =" test_plugin_name_1"
6
- type =" Foo\Bar\Plugin\TestOnePlugin" sortOrder =" 10" />
6
+ type =" Foo\Bar\Plugin\TestOnePlugin"
7
+ sortOrder =" 10" />
7
8
</type >
8
9
</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 {
25
25
private static final String MODULE = "Foo_Bar" ;
26
26
private static final String MODULE_DIR = "src/app/code/Foo/Bar/" ;
27
27
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
+
28
52
/**
29
53
* Test checks whether di.xml is generated correctly for the base area
30
54
*/
You can’t perform that action at this time.
0 commit comments