forked from magento/magento2-phpstorm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObserverCompletionRegistrarTest.java
38 lines (29 loc) · 1.25 KB
/
ObserverCompletionRegistrarTest.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
/*
* 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.ModuleEventsXml;
public class ObserverCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
private static final String[] lookupStringsEntities = new String[] {
"Magento\\Catalog\\Observer\\TestObserver"
};
private static final String[] lookupStringsEvents = new String[] {
"test_event_in_block"
};
public void testEventsXmlMustHaveCompletion() {
String filePath = this.getFixturePath(ModuleEventsXml.FILE_NAME);
myFixture.copyFileToProject(filePath);
assertFileContainsCompletions(filePath, lookupStringsEntities);
}
public void testNotEventsXmlMustBeEmpty() {
String filePath = this.getFixturePath("notevents.xml");
myFixture.copyFileToProject(filePath);
assertCompletionNotShowing(filePath);
}
public void testEventsXmlEventNameMustHaveCompletion() {
String filePath = this.getFixturePath(ModuleEventsXml.FILE_NAME);
myFixture.copyFileToProject(filePath);
assertFileContainsCompletions(filePath, lookupStringsEvents);
}
}