Skip to content

Commit 13fb65a

Browse files
committed
Added tests for module name completion in module.xml
1 parent 0cd107b commit 13fb65a

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
10+
<module name="Magento_C<caret>"/>
11+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
10+
<module name="Magento_Theme">
11+
<sequence>
12+
<module name="Magento_C<caret>"/>
13+
</sequence>
14+
</module>
15+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.completion.xml;
7+
8+
public class ModuleNameCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
9+
private static final String[] LOOKUP_MODULE_NAMES = new String[] {
10+
"Magento_Catalog",
11+
"Magento_Config"
12+
};
13+
14+
/**
15+
* Tests for module name completion in module.xml
16+
*/
17+
public void testModuleNameMustHaveCompletion() {
18+
final String filePath = this.getFixturePath("module.xml");
19+
myFixture.copyFileToProject(filePath);
20+
21+
assertFileContainsCompletions(filePath, LOOKUP_MODULE_NAMES);
22+
}
23+
24+
/**
25+
* Tests for module name completion under the sequence node in module.xml
26+
*/
27+
public void testSequenceModuleNameMustHaveCompletion() {
28+
final String filePath = this.getFixturePath("module.xml");
29+
myFixture.copyFileToProject(filePath);
30+
31+
assertFileContainsCompletions(filePath, LOOKUP_MODULE_NAMES);
32+
}
33+
}

0 commit comments

Comments
 (0)