@@ -51,10 +51,10 @@ public function testFilter($input, $expectedOutput)
51
51
{
52
52
$ this ->purifier ->expects (self ::atLeastOnce ())
53
53
->method ('purify ' )
54
- ->will (
55
- $ this -> returnCallback ( function ($ arg ) {
54
+ ->willReturnCallback (
55
+ function ($ arg ) {
56
56
return $ arg ;
57
- })
57
+ }
58
58
);
59
59
self ::assertEquals ($ expectedOutput , $ this ->filter ->filter ($ input ));
60
60
}
@@ -135,7 +135,7 @@ public function filterDataProvider()
135
135
],
136
136
'Nested malicious tags ' => [
137
137
'<scri<script>pt>alert(1);</scri<script>pt> ' ,
138
- 'alert(1) ' ,
138
+ 'alert(1); ' ,
139
139
],
140
140
'Nested scripts ' => [
141
141
'<?php echo "test" ?> ' ,
@@ -149,10 +149,6 @@ public function filterDataProvider()
149
149
'<?=$test?> ' ,
150
150
'' ,
151
151
],
152
- 'Commandline injections ' => [
153
- 'ping -c3 www.example.com && links www.sample.com ' ,
154
- 'ping -c3 www.example.com links www.sample.com ' ,
155
- ],
156
152
'Null Value ' => [null , '' ],
157
153
];
158
154
}
@@ -166,7 +162,11 @@ public function testAddExpression()
166
162
167
163
$ this ->purifier ->expects (self ::atLeastOnce ())
168
164
->method ('purify ' )
169
- ->willReturn ('Custom malicious tag is removed customMalicious ' );
165
+ ->willReturnCallback (
166
+ function ($ arg ) {
167
+ return $ arg ;
168
+ }
169
+ );
170
170
171
171
$ this ->filter ->addExpression ($ customExpression );
172
172
$ this ->assertEquals (
@@ -188,7 +188,11 @@ public function testSetExpression()
188
188
189
189
$ this ->purifier ->expects (self ::atLeastOnce ())
190
190
->method ('purify ' )
191
- ->willReturn ("Custom \tmalicious tag \t\t is removed customMalicious " );
191
+ ->willReturnCallback (
192
+ function ($ arg ) {
193
+ return $ arg ;
194
+ }
195
+ );
192
196
193
197
$ this ->filter ->setExpressions ([$ customExpression ]);
194
198
$ this ->assertEquals (
0 commit comments