Skip to content

Commit 54d55c0

Browse files
committed
MAGETWO-65470: The visibility conditions improvements
Static fixes.
1 parent b87d0f6 commit 54d55c0

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

dev/tests/integration/testsuite/Magento/Framework/View/Layout/Reader/BlockTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public function testInterpretBlockDirective()
6767
Block::ATTRIBUTE_TEMPLATE => 'test.phtml',
6868
Block::ATTRIBUTE_TTL => 3,
6969
Block::ATTRIBUTE_DISPLAY => '',
70-
Block::ATTRIBUTE_ACL => ''
70+
Block::ATTRIBUTE_ACL => '',
71+
'visibilityConditions' => [],
7172
],
7273
$resultElementData['attributes']
7374
);

lib/internal/Magento/Framework/View/Layout/Reader/Visibility/Condition.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
use Magento\Framework\Data\Argument\InterpreterInterface;
99
use Magento\Framework\Simplexml\Element;
10+
use Magento\Framework\View\Layout\AclCondition;
1011
use Magento\Framework\View\Layout\Argument\Parser;
12+
use Magento\Framework\View\Layout\ConfigCondition;
1113

1214
/**
1315
* Parse conditions from element.
@@ -41,7 +43,6 @@ public function __construct(
4143
$this->argumentInterpreter = $argumentInterpreter;
4244
}
4345

44-
4546
/**
4647
* @param Element $element
4748
*
@@ -53,7 +54,7 @@ public function parseConditions(Element $element)
5354
$configPath = (string)$element->getAttribute('ifconfig');
5455
if (!empty($configPath)) {
5556
$visibilityConditions['ifconfig'] = [
56-
'name' => 'Magento\Framework\View\Layout\ConfigCondition',
57+
'name' => ConfigCondition::class,
5758
'arguments' => [
5859
'configPath' => $configPath
5960
],
@@ -63,7 +64,7 @@ public function parseConditions(Element $element)
6364
$aclResource = (string)$element->getAttribute('aclResource');
6465
if (!empty($aclResource)) {
6566
$visibilityConditions['acl'] = [
66-
'name' => 'Magento\Framework\View\Layout\AclCondition',
67+
'name' => AclCondition::class,
6768
'arguments' => [
6869
'acl' => $aclResource
6970
],

lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/BlockTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
namespace Magento\Framework\View\Test\Unit\Layout\Reader;
1111

1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13+
use Magento\Framework\View\Layout\AclCondition;
14+
use Magento\Framework\View\Layout\ConfigCondition;
1315
use Magento\Framework\View\Layout\Reader\Block;
1416
use Magento\Framework\View\Layout\Reader\Visibility\Condition;
1517

@@ -179,7 +181,7 @@ public function processBlockDataProvider()
179181
'',
180182
[
181183
'acl' => [
182-
'name' => 'Magento\Framework\View\Layout\AclCondition',
184+
'name' => AclCondition::class,
183185
'arguments' => [
184186
'acl' => 'test'
185187
],
@@ -196,13 +198,13 @@ public function processBlockDataProvider()
196198
'config_path',
197199
[
198200
'acl' => [
199-
'name' => 'Magento\Framework\View\Layout\AclCondition',
201+
'name' => AclCondition::class,
200202
'arguments' => [
201203
'acl' => 'test'
202204
],
203205
],
204206
'ifconfig' => [
205-
'name' => 'Magento\Framework\View\Layout\ConfigCondition',
207+
'name' => ConfigCondition::class,
206208
'arguments' => [
207209
'configPath' => 'config_path'
208210
],
@@ -219,13 +221,13 @@ public function processBlockDataProvider()
219221
'',
220222
[
221223
'acl' => [
222-
'name' => 'Magento\Framework\View\Layout\AclCondition',
224+
'name' => AclCondition::class,
223225
'arguments' => [
224226
'acl' => 'test'
225227
],
226228
],
227229
'ifconfig' => [
228-
'name' => 'Magento\Framework\View\Layout\ConfigCondition',
230+
'name' => ConfigCondition::class,
229231
'arguments' => [
230232
'configPath' => 'config_path'
231233
],

lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/UiComponentTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
namespace Magento\Framework\View\Test\Unit\Layout\Reader;
1111

1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13+
use Magento\Framework\View\Layout\AclCondition;
14+
use Magento\Framework\View\Layout\ConfigCondition;
1315
use Magento\Framework\View\Layout\Reader\Context;
1416
use Magento\Framework\View\Layout\Reader\UiComponent;
1517
use Magento\Framework\View\Layout\Reader\Visibility\Condition;
@@ -86,13 +88,13 @@ public function testInterpret($element)
8688
'aclResource' => 'test_acl',
8789
'visibilityConditions' => [
8890
'ifconfig' => [
89-
'name' => 'Magento\Framework\View\Layout\ConfigCondition',
91+
'name' => ConfigCondition::class,
9092
'arguments' => [
9193
'configPath' => 'config_path'
9294
],
9395
],
9496
'acl' => [
95-
'name' => 'Magento\Framework\View\Layout\AclCondition',
97+
'name' => AclCondition::class,
9698
'arguments' => [
9799
'acl' => 'test_acl'
98100
],

0 commit comments

Comments
 (0)