2
2
* Copyright © Magento, Inc. All rights reserved.
3
3
* See COPYING.txt for license details.
4
4
*/
5
+
5
6
package com .magento .idea .magento2plugin .completion .xml ;
6
7
7
8
import com .magento .idea .magento2plugin .magento .files .ModuleConfigXml ;
8
9
import com .magento .idea .magento2plugin .magento .files .ModuleSystemXmlFile ;
9
10
10
11
public class BackendModelXmlCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
11
12
12
- private static final String [] systemXmlBackendModelLookupStringCheck = new String [] {
13
+ private static final String [] SYSTEM_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK = {
13
14
"Magento\\ Backend\\ Model\\ Source\\ Roles"
14
15
};
15
- private static final String [] configXmlBackendModelLookupStringCheck = new String [] {
16
+ private static final String [] CONFIG_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK = {
16
17
"Magento\\ Backend\\ Model\\ Source\\ YesNo"
17
18
};
18
19
19
20
public void testSystemXmlElementProvideCompletion () {
20
- String filePath = this .getFixturePath (ModuleSystemXmlFile .FILE_NAME );
21
+ final String filePath = this .getFixturePath (ModuleSystemXmlFile .FILE_NAME );
21
22
myFixture .configureByFile (filePath );
22
23
23
- assertCompletionContains (filePath , systemXmlBackendModelLookupStringCheck );
24
+ assertCompletionContains (filePath , SYSTEM_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK );
24
25
}
25
26
26
27
public void testSystemXmlElementCompletionWontShow () {
27
- String filePath = this .getFixturePath (
28
+ final String filePath = this .getFixturePath (
28
29
ModuleSystemXmlFile .FILE_NAME
29
30
);
30
31
myFixture .copyFileToProject (filePath );
@@ -33,35 +34,35 @@ public void testSystemXmlElementCompletionWontShow() {
33
34
}
34
35
35
36
public void testSystemXmlBackendModelAttributeMatchWithFile () {
36
- String filePath = this .getFixturePath (
37
+ final String filePath = this .getFixturePath (
37
38
ModuleSystemXmlFile .FILE_NAME
38
39
);
39
40
40
- assertFileContainsCompletions (filePath , systemXmlBackendModelLookupStringCheck );
41
+ assertFileContainsCompletions (filePath , SYSTEM_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK );
41
42
}
42
43
43
44
public void testSystemXmlBackendModelAttributeDontMatchWithFile () {
44
- String filePath = this .getFixturePath (
45
+ final String filePath = this .getFixturePath (
45
46
"other-file-than-system.xml"
46
47
);
47
48
48
49
assertFileNotContainsCompletions (
49
50
filePath ,
50
- systemXmlBackendModelLookupStringCheck
51
+ SYSTEM_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK
51
52
);
52
53
}
53
54
54
55
public void testConfigXmlElementProvideCompletion () {
55
- String filePath = this .getFixturePath (
56
+ final String filePath = this .getFixturePath (
56
57
ModuleConfigXml .FILE_NAME
57
58
);
58
59
myFixture .copyFileToProject (filePath );
59
60
60
- assertCompletionContains (filePath , configXmlBackendModelLookupStringCheck );
61
+ assertCompletionContains (filePath , CONFIG_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK );
61
62
}
62
63
63
64
public void testConfigXmlElementCompletionWontShow () {
64
- String filePath = this .getFixturePath (
65
+ final String filePath = this .getFixturePath (
65
66
ModuleConfigXml .FILE_NAME
66
67
);
67
68
myFixture .copyFileToProject (filePath );
@@ -70,21 +71,21 @@ public void testConfigXmlElementCompletionWontShow() {
70
71
}
71
72
72
73
public void testConfigXmlBackendModelAttributeMatchWithFile () {
73
- String filePath = this .getFixturePath (
74
+ final String filePath = this .getFixturePath (
74
75
ModuleConfigXml .FILE_NAME
75
76
);
76
77
77
- assertFileContainsCompletions (filePath , configXmlBackendModelLookupStringCheck );
78
+ assertFileContainsCompletions (filePath , CONFIG_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK );
78
79
}
79
80
80
81
public void testConfigXmlBackendModelAttributeDontMatchWithFile () {
81
- String filePath = this .getFixturePath (
82
+ final String filePath = this .getFixturePath (
82
83
"other-file-than-config.xml"
83
84
);
84
85
85
86
assertFileNotContainsCompletions (
86
87
filePath ,
87
- configXmlBackendModelLookupStringCheck
88
+ CONFIG_XML_BACKEND_MODEL_LOOKUP_STRING_CHECK
88
89
);
89
90
}
90
91
}
0 commit comments