14
14
use PHPUnit_Framework_MockObject_MockObject as MockObject ;
15
15
16
16
/**
17
- * BlockActionsTest contains unit tests for \Magento\Cms\Ui\Component\Listing\Column\BlockActions class
17
+ * BlockActionsTest contains unit tests for \Magento\Cms\Ui\Component\Listing\Column\BlockActions class.
18
18
*/
19
19
class BlockActionsTest extends \PHPUnit_Framework_TestCase
20
20
{
@@ -33,6 +33,9 @@ class BlockActionsTest extends \PHPUnit_Framework_TestCase
33
33
*/
34
34
private $ urlBuilder ;
35
35
36
+ /**
37
+ * @inheritdoc
38
+ */
36
39
protected function setUp ()
37
40
{
38
41
$ objectManager = new ObjectManager ($ this );
@@ -42,15 +45,15 @@ protected function setUp()
42
45
$ processor = $ this ->getMockBuilder (Processor::class)
43
46
->disableOriginalConstructor ()
44
47
->getMock ();
45
- $ context ->expects (static :: once ())
48
+ $ context ->expects ($ this -> once ())
46
49
->method ('getProcessor ' )
47
50
->willReturn ($ processor );
48
51
49
52
$ this ->urlBuilder = $ this ->getMock (UrlInterface::class);
50
53
51
54
$ this ->escaper = $ this ->getMockBuilder (Escaper::class)
52
55
->disableOriginalConstructor ()
53
- ->setMethods (['escapeHtml ' ])
56
+ ->setMethods (['escapeHtmlAttr ' ])
54
57
->getMock ();
55
58
56
59
$ this ->blockActions = $ objectManager ->getObject (BlockActions::class, [
@@ -62,7 +65,10 @@ protected function setUp()
62
65
}
63
66
64
67
/**
68
+ * Unit test for prepareDataSource method.
69
+ *
65
70
* @covers \Magento\Cms\Ui\Component\Listing\Column\BlockActions::prepareDataSource
71
+ * @return void
66
72
*/
67
73
public function testPrepareDataSource ()
68
74
{
@@ -73,7 +79,7 @@ public function testPrepareDataSource()
73
79
'items ' => [
74
80
[
75
81
'block_id ' => $ blockId ,
76
- 'title ' => $ title
82
+ 'title ' => $ title,
77
83
],
78
84
],
79
85
],
@@ -93,20 +99,20 @@ public function testPrepareDataSource()
93
99
'label ' => __ ('Delete ' ),
94
100
'confirm ' => [
95
101
'title ' => __ ('Delete %1 ' , $ title ),
96
- 'message ' => __ ('Are you sure you wan \' t to delete a %1 record? ' , $ title )
102
+ 'message ' => __ ('Are you sure you want to delete a %1 record? ' , $ title ),
97
103
],
98
104
'post ' => true ,
99
105
],
100
106
],
101
107
],
102
108
];
103
109
104
- $ this ->escaper ->expects (static :: once ())
105
- ->method ('escapeHtml ' )
110
+ $ this ->escaper ->expects ($ this -> once ())
111
+ ->method ('escapeHtmlAttr ' )
106
112
->with ($ title )
107
113
->willReturn ($ title );
108
114
109
- $ this ->urlBuilder ->expects (static :: exactly (2 ))
115
+ $ this ->urlBuilder ->expects ($ this -> exactly (2 ))
110
116
->method ('getUrl ' )
111
117
->willReturnMap (
112
118
[
@@ -130,6 +136,6 @@ public function testPrepareDataSource()
130
136
$ this ->blockActions ->setData ('name ' , $ name );
131
137
132
138
$ actual = $ this ->blockActions ->prepareDataSource ($ items );
133
- static :: assertEquals ($ expectedItems , $ actual ['data ' ]['items ' ]);
139
+ $ this -> assertEquals ($ expectedItems , $ actual ['data ' ]['items ' ]);
134
140
}
135
141
}
0 commit comments