8
8
import com .intellij .openapi .vfs .VirtualFile ;
9
9
import com .magento .idea .magento2plugin .magento .files .ModuleSystemXml ;
10
10
import com .magento .idea .magento2plugin .magento .files .ModuleWidgetXml ;
11
-
12
- import java .io .File ;
13
11
import java .io .IOException ;
14
12
15
13
public class SourceModelXmlCompletionRegistrarTest extends CompletionLightJavaCodeInsightFixtureTestCase {
@@ -18,22 +16,14 @@ public class SourceModelXmlCompletionRegistrarTest extends CompletionLightJavaCo
18
16
private static VirtualFile widgetXmlVirtualFile ;
19
17
private static final String fixturesFolderPath ;
20
18
private static final String classesSourceFile ;
21
- private static final String multipleCompletionFolder ;
22
- private static final String [] singleLookupStringsCheck ;
23
- private static final String [] multipleLookupStringsCheck ;
19
+ private static final String [] lookupStringsCheck ;
24
20
25
21
static {
26
- multipleCompletionFolder = "multipleCompletion" ;
27
- fixturesFolderPath = "tests/com/magento/idea/magento2plugin/completion/xml/fixtures" ;
22
+ fixturesFolderPath = "testData/completion/common/" ;
28
23
classesSourceFile = "classes.php" ;
29
- singleLookupStringsCheck = new String []{
24
+ lookupStringsCheck = new String []{
30
25
"Magento\\ Config\\ Model\\ Config\\ Source\\ Yesno"
31
26
};
32
- multipleLookupStringsCheck = new String []{
33
- "Magento\\ Backend\\ Model\\ Source\\ Roles" ,
34
- "Magento\\ Customer\\ Model\\ Source\\ Roles" ,
35
- "Magento\\ B2b\\ Model\\ Source\\ Roles"
36
- };
37
27
}
38
28
39
29
@ Override
@@ -49,56 +39,39 @@ protected String getTestDataPath() {
49
39
return fixturesFolderPath ;
50
40
}
51
41
52
- public void testThatSourceModelXmlElementMustProvideCompletion () {
53
- assertCompletionContains (ModuleSystemXml .FILE_NAME , singleLookupStringsCheck );
54
- }
55
-
56
- public void testThatSourceModelXmlElementMustProvideMultipleCompletion () {
57
- String multipleCompletionFile = String .join (
58
- File .separator ,
59
- new String []{multipleCompletionFolder , ModuleSystemXml .FILE_NAME }
60
- );
61
- assertCompletionContains (multipleCompletionFile , multipleLookupStringsCheck );
42
+ public void testSourceModelXmlElementMustProvideCompletion () {
43
+ assertCompletionContains (ModuleSystemXml .FILE_NAME , lookupStringsCheck );
62
44
}
63
45
64
- public void testThatSourceModelXmlElementMuchWithFilePositiveCase () {
65
- assertCompletionMuchWithFilePositiveCase (ModuleSystemXml .FILE_NAME , singleLookupStringsCheck );
46
+ public void testSourceModelXmlElementMatchWithFilePositiveCase () {
47
+ assertCompletionMatchWithFilePositiveCase (ModuleSystemXml .FILE_NAME , lookupStringsCheck );
66
48
}
67
49
68
- public void testThatSourceModelXmlElementMuchWithFileNegativeCase () throws IOException {
50
+ public void testSourceModelXmlElementMatchWithFileNegativeCase () throws IOException {
69
51
String negativeFilePath = "not" + ModuleSystemXml .FILE_NAME ;
70
52
71
- assertCompletionMuchWithFileNegativeCase (
53
+ assertCompletionMatchWithFileNegativeCase (
72
54
negativeFilePath ,
73
55
VfsUtil .loadText (systemXmlVirtualFile ),
74
- singleLookupStringsCheck
56
+ lookupStringsCheck
75
57
);
76
58
}
77
59
78
- public void testThatSourceModelXmlAttributeMustProvideCompletion () {
79
- assertCompletionContains (ModuleWidgetXml .FILE_NAME , singleLookupStringsCheck );
80
- }
81
-
82
- public void testThatSourceModelXmlAttributeMustProvideMultipleCompletion () {
83
- String multipleCompletionFile = String .join (
84
- File .separator ,
85
- new String []{multipleCompletionFolder , ModuleWidgetXml .FILE_NAME }
86
- );
87
-
88
- assertCompletionContains (multipleCompletionFile , multipleLookupStringsCheck );
60
+ public void testSourceModelXmlAttributeMustProvideCompletion () {
61
+ assertCompletionContains (ModuleWidgetXml .FILE_NAME , lookupStringsCheck );
89
62
}
90
63
91
- public void testThatSourceModelXmlAttributeMuchWithFilePositiveCase () {
92
- assertCompletionMuchWithFilePositiveCase (ModuleWidgetXml .FILE_NAME , singleLookupStringsCheck );
64
+ public void testSourceModelXmlAttributeMatchWithFilePositiveCase () {
65
+ assertCompletionMatchWithFilePositiveCase (ModuleWidgetXml .FILE_NAME , lookupStringsCheck );
93
66
}
94
67
95
- public void testThatSourceModelXmlAttributeMuchWithFileNegativeCase () throws IOException {
68
+ public void testSourceModelXmlAttributeMatchWithFileNegativeCase () throws IOException {
96
69
String negativeFilePath = "not" + ModuleWidgetXml .FILE_NAME ;
97
70
98
- assertCompletionMuchWithFileNegativeCase (
71
+ assertCompletionMatchWithFileNegativeCase (
99
72
negativeFilePath ,
100
73
VfsUtil .loadText (widgetXmlVirtualFile ),
101
- singleLookupStringsCheck
74
+ lookupStringsCheck
102
75
);
103
76
}
104
77
}
0 commit comments