Skip to content

Commit 2423fac

Browse files
Karpenko, OleksandrTommy Quissens
Karpenko, Oleksandr
authored and
Tommy Quissens
committed
MAGETWO-54935: [Github #1931] Cancellation of element removal in layouts doesn't work
-- integration test
1 parent 44746e0 commit 2423fac

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

dev/tests/integration/testsuite/Magento/Framework/View/LayoutDirectivesTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,18 @@ public function testRemove()
198198
$this->assertTrue($layout->isBlock('child_block2'));
199199
}
200200

201+
/**
202+
* @magentoAppIsolation enabled
203+
*/
204+
public function testRemoveCancellation()
205+
{
206+
$layout = $this->_getLayoutModel('remove_cancellation.xml');
207+
$this->assertTrue($layout->isContainer('container1'));
208+
$this->assertTrue($layout->isBlock('child_block1'));
209+
$this->assertTrue($layout->isBlock('no_name2'));
210+
$this->assertFalse($layout->getBlock('not_exist'));
211+
}
212+
201213
/**
202214
* @magentoAppIsolation enabled
203215
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<layout>
9+
<container name="container1" label="Container 1">
10+
<block class="Magento\Framework\View\Element\Text" name="no_name2"/>
11+
</container>
12+
<referenceContainer name="container1" remove="true"/>
13+
<referenceBlock name="child_block1" remove="true"/>
14+
<block class="Magento\Framework\View\Element\Text" name="block_container" as="block.container">
15+
<block class="Magento\Framework\View\Element\Text" name="child_block1"/>
16+
<block class="Magento\Framework\View\Element\Text" name="child_block2"/>
17+
</block>
18+
<referenceContainer name="not_exist" remove="false"/>
19+
<referenceContainer name="container1" remove="false"/>
20+
<referenceBlock name="child_block1" remove="false"/>
21+
</layout>

0 commit comments

Comments
 (0)