File tree Expand file tree Collapse file tree 6 files changed +73
-4
lines changed
completion/xml/LayoutContainerCompletionRegistrar/referenceContainerMustHaveCompletion
project/magento2/vendor/magento/module-catalog/view/frontend/layout
reference/xml/LayoutContainerReferenceRegistrar/referenceContainerMustHaveReference
tests/com/magento/idea/magento2plugin Expand file tree Collapse file tree 6 files changed +73
-4
lines changed Original file line number Diff line number Diff line change 1313 <description >
1414 Magento PhpStorm rules
1515 </description >
16- <rule ref =" category/java/bestpractices.xml" />
17- <rule ref =" category/java/codestyle.xml" />
16+ <rule ref =" category/java/bestpractices.xml" >
17+ <exclude name =" JUnit4TestShouldUseTestAnnotation" />
18+ </rule >
19+ <rule ref =" category/java/codestyle.xml" >
20+ <exclude name =" AtLeastOneConstructor" />
21+ </rule >
1822 <rule ref =" category/java/design.xml" >
1923 <exclude name =" LawOfDemeter" />
2024 </rule >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+
3+ <page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
4+ <body >
5+ <referenceContainer name =" test_index_index<caret>" />
6+ </body >
7+ </page >
Original file line number Diff line number Diff line change 22
33<page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
44 <body >
5- <referenceContainer name =" after.body.start " >
5+ <container name =" test_index_index_container " >
66 <block name =" test_index_index_block" />
7+ </container >
8+ <container name =" test_index_index_container2" >
79 <block name =" test_index_index_block2" />
8- </referenceContainer >
10+ </container >
911 </body >
1012</page >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+
3+ <page xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:View/Layout/etc/page_configuration.xsd" >
4+ <body >
5+ <referenceContainer name =" test_index_index_container2<caret>" >
6+ </referenceContainer >
7+ </body >
8+ </page >
Original file line number Diff line number Diff line change 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 .LayoutXml ;
9+
10+ public class LayoutContainerCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
11+
12+ /**
13+ * The `name` attribute of the `referenceContainer` tag in layout XML must
14+ * have completion based on `name` attribute of `container` tags.
15+ */
16+ public void testReferenceContainerMustHaveCompletion () {
17+ final String filePath = this .getFixturePath (LayoutXml .DEFAULT_FILENAME );
18+ myFixture .configureByFile (filePath );
19+
20+ assertCompletionContains (
21+ filePath ,
22+ "test_index_index_container" ,
23+ "test_index_index_container2"
24+ );
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright © Magento, Inc. All rights reserved.
3+ * See COPYING.txt for license details.
4+ */
5+
6+ package com .magento .idea .magento2plugin .reference .xml ;
7+
8+ import com .magento .idea .magento2plugin .magento .files .LayoutXml ;
9+
10+ public class LayoutContainerReferenceRegistrarTest extends ReferenceXmlFixtureTestCase {
11+
12+ /**
13+ * The `name` attribute of the `referenceContainer` tag in layout XML must
14+ * have reference to the `name` attribute of `container` tag.
15+ */
16+ public void testReferenceContainerMustHaveReference () {
17+ final String filePath = this .getFixturePath (LayoutXml .DEFAULT_FILENAME );
18+ myFixture .configureByFile (filePath );
19+
20+ assertHasReferenceToXmlTag ("container" );
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments