Skip to content

Commit 3ee3d54

Browse files
author
Vitaliy Boyko
committedMay 11, 2020
Added test coverage for the layout update handle
1 parent d6a6cca commit 3ee3d54

File tree

5 files changed

+62
-0
lines changed

5 files changed

+62
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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+
<update handle="test_index<caret>" />
5+
</page>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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+
</body>
6+
</page>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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+
<update handle="test_index_index<caret>" />
5+
</page>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 LayoutUpdateHandleCompletionRegistrarTest extends CompletionXmlFixtureTestCase {
9+
10+
/**
11+
* The `handle` attribute of the `update` tag in the layout XML must
12+
* have completion based on layout index.
13+
*/
14+
public void testUpdateHandleMustHaveCompletion() {
15+
final String filePath = this.getFixturePath("test_test_test.xml");
16+
myFixture.configureByFile(filePath);
17+
18+
assertCompletionContains(
19+
filePath,
20+
"test_index_index",
21+
"test_index_index2"
22+
);
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
public class LayoutUpdateHandleReferenceRegistrarTest extends ReferenceXmlFixtureTestCase {
9+
10+
/**
11+
* The `handle` attribute of the `update` tag in the layout XML must
12+
* have reference to the layout.
13+
*/
14+
public void testLayoutUpdateHandleMustHaveReference() {
15+
final String filePath = this.getFixturePath("test_test_test.xml");
16+
myFixture.configureByFile(filePath);
17+
18+
assertHasReferenceToFile(
19+
"magento/module-catalog/view/frontend/layout/test_index_index.xml"
20+
);
21+
}
22+
}

0 commit comments

Comments
 (0)
Please sign in to comment.