forked from magento/magento2-phpstorm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSourceModelXmlCompletionRegistrarTest.java
64 lines (49 loc) · 2.17 KB
/
SourceModelXmlCompletionRegistrarTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
package com.magento.idea.magento2plugin.completion.xml;
import com.magento.idea.magento2plugin.magento.files.ModuleSystemXml;
import com.magento.idea.magento2plugin.magento.files.ModuleWidgetXml;
import java.io.IOException;
public class SourceModelXmlCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
private static final String[] lookupStringsCheck = new String[]{
"Magento\\Backend\\Model\\Source\\YesNo"
};
public void testSourceModelXmlElementMustProvideCompletion() {
String filePath = this.getFixturePath(ModuleSystemXml.FILE_NAME);
myFixture.copyFileToProject(filePath);
assertCompletionContains(filePath, lookupStringsCheck);
}
public void testSourceModelXmlElementMatchWithFilePositiveCase() {
String filePath = this.getFixturePath(ModuleSystemXml.FILE_NAME);
myFixture.copyFileToProject(filePath);
assertFileContainsCompletions(filePath, lookupStringsCheck);
}
public void testSourceModelXmlElementMatchWithFileNegativeCase() {
String filePath = this.getFixturePath("not-system.xml");
myFixture.copyFileToProject(filePath);
assertFileNotContainsCompletions(
filePath,
lookupStringsCheck
);
}
public void testSourceModelXmlAttributeMustProvideCompletion() {
String filePath = this.getFixturePath(ModuleWidgetXml.FILE_NAME);
myFixture.copyFileToProject(filePath);
assertCompletionContains(filePath, lookupStringsCheck);
}
public void testSourceModelXmlAttributeMatchWithFilePositiveCase() {
String filePath = this.getFixturePath(ModuleWidgetXml.FILE_NAME);
myFixture.copyFileToProject(filePath);
assertFileContainsCompletions(filePath, lookupStringsCheck);
}
public void testSourceModelXmlAttributeMatchWithFileNegativeCase() throws IOException {
String filePath = this.getFixturePath("not-widget.xml");
myFixture.copyFileToProject(filePath);
assertFileNotContainsCompletions(
filePath,
lookupStringsCheck
);
}
}