Skip to content

Commit 32d53d9

Browse files
600: Added test cases
1 parent 0add2b2 commit 32d53d9

File tree

8 files changed

+398
-0
lines changed

8 files changed

+398
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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:module:Magento_Store:etc/config.xsd">
10+
<default>
11+
<catalog>
12+
<frontend>
13+
<caret>
14+
</frontend>
15+
</catalog>
16+
</default>
17+
</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:module:Magento_Store:etc/config.xsd">
10+
<default>
11+
<catalog>
12+
f<caret>
13+
</catalog>
14+
</default>
15+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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:module:Magento_Store:etc/config.xsd">
10+
<default>
11+
<caret>
12+
</default>
13+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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:module:Magento_Config:etc/system_file.xsd">
10+
<system>
11+
<section id="catalog">
12+
<group id="frontend">
13+
<field id="list<caret>"/>
14+
</group>
15+
</section>
16+
</system>
17+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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:module:Magento_Config:etc/system_file.xsd">
10+
<system>
11+
<section id="catalog">
12+
<group id="f<caret>">
13+
</group>
14+
</section>
15+
</system>
16+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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:module:Magento_Config:etc/system_file.xsd">
10+
<system>
11+
<section id="<caret>">
12+
</section>
13+
</system>
14+
</config>

testData/project/magento2/vendor/magento/module-catalog/etc/adminhtml/system.xml

Lines changed: 240 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
import com.magento.idea.magento2plugin.magento.files.ModuleConfigXmlFile;
9+
import com.magento.idea.magento2plugin.magento.files.ModuleSystemXmlFile;
10+
11+
public class SystemConfigurationPathsCompletionTest extends CompletionXmlFixtureTestCase {
12+
13+
/**
14+
* Test system xml section element completion.
15+
*/
16+
public void testSystemXmlSectionMustProvideCompletion() {
17+
final String filePath = this.getFixturePath(ModuleSystemXmlFile.FILE_NAME);
18+
myFixture.copyFileToProject(filePath);
19+
assertCompletionContains(filePath, "catalog");
20+
}
21+
22+
/**
23+
* Test system xml group element completion.
24+
*/
25+
public void testSystemXmlGroupMustProvideCompletion() {
26+
final String filePath = this.getFixturePath(ModuleSystemXmlFile.FILE_NAME);
27+
myFixture.copyFileToProject(filePath);
28+
assertCompletionContains(filePath, "frontend");
29+
}
30+
31+
/**
32+
* Test system xml field element completion.
33+
*/
34+
public void testSystemXmlFieldMustProvideCompletion() {
35+
final String filePath = this.getFixturePath(ModuleSystemXmlFile.FILE_NAME);
36+
myFixture.copyFileToProject(filePath);
37+
assertCompletionContains(filePath, "list_allow_all");
38+
}
39+
40+
/**
41+
* Test config xml section element completion.
42+
*/
43+
public void testConfigXmlSectionMustProvideCompletion() {
44+
final String filePath = this.getFixturePath(ModuleConfigXmlFile.FILE_NAME);
45+
myFixture.copyFileToProject(filePath);
46+
assertCompletionContains(filePath, "catalog");
47+
}
48+
49+
/**
50+
* Test config xml group element completion.
51+
*/
52+
public void testConfigXmlGroupMustProvideCompletion() {
53+
final String filePath = this.getFixturePath(ModuleConfigXmlFile.FILE_NAME);
54+
myFixture.copyFileToProject(filePath);
55+
assertCompletionContains(filePath, "frontend");
56+
}
57+
58+
/**
59+
* Test config xml field element completion.
60+
*/
61+
public void testConfigXmlFieldMustProvideCompletion() {
62+
final String filePath = this.getFixturePath(ModuleConfigXmlFile.FILE_NAME);
63+
myFixture.copyFileToProject(filePath);
64+
assertCompletionContains(filePath, "list_allow_all");
65+
}
66+
}

0 commit comments

Comments
 (0)