1
1
<?php
2
-
2
+ /**
3
+ * Copyright © 2015 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
3
6
namespace Magento \Framework \View \Layout \Reader ;
4
7
5
8
class BlockTest extends \PHPUnit_Framework_TestCase
@@ -17,28 +20,35 @@ class BlockTest extends \PHPUnit_Framework_TestCase
17
20
*/
18
21
private $ readerContext ;
19
22
23
+ /**
24
+ * @var string
25
+ */
20
26
private $ blockName = 'test.block ' ;
27
+
28
+ /**
29
+ * @var string
30
+ */
21
31
private $ childBlockName = 'test.child.block ' ;
22
32
23
33
public function setUp ()
24
34
{
25
35
$ this ->block = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
26
36
'Magento\Framework\View\Layout\Reader\Block '
27
37
);
28
-
29
38
$ this ->readerContext = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
30
39
'Magento\Framework\View\Layout\Reader\Context '
31
40
);
32
41
}
33
42
34
43
public function testInterpretBlockDirective ()
35
44
{
36
- $ pageXml = new \Magento \Framework \View \Layout \Element (__DIR__ . '/_files/_layout_update_block.xml ' , 0 , true );
45
+ $ pageXml = new \Magento \Framework \View \Layout \Element (
46
+ __DIR__ . '/_files/_layout_update_block.xml ' , 0 , true
47
+ );
37
48
$ parentElement = new \Magento \Framework \View \Layout \Element ('<page></page> ' );
38
49
39
50
foreach ($ pageXml ->xpath ('body/block ' ) as $ blockElement ) {
40
51
$ this ->assertTrue (in_array ($ blockElement ->getName (), $ this ->block ->getSupportedNodes ()));
41
-
42
52
$ this ->block ->interpret ($ this ->readerContext , $ blockElement , $ parentElement );
43
53
}
44
54
@@ -73,7 +83,6 @@ public function testInterpretReferenceBlockDirective()
73
83
74
84
foreach ($ pageXml ->xpath ('body/* ' ) as $ element ) {
75
85
$ this ->assertTrue (in_array ($ element ->getName (), $ this ->block ->getSupportedNodes ()));
76
-
77
86
$ this ->block ->interpret ($ this ->readerContext , $ element , $ parentElement );
78
87
}
79
88
@@ -88,4 +97,4 @@ public function testInterpretReferenceBlockDirective()
88
97
$ resultElementData ['arguments ' ]
89
98
);
90
99
}
91
- }
100
+ }
0 commit comments