@@ -20,19 +20,19 @@ public function testBasicFunctionality()
20
20
$ d ->mergeDumperOptions (array ('styles ' => $ this ->testStyles ));
21
21
$ out = $ d ->renderVar ('magic ' );
22
22
23
- $ this ->assertContains ('magic ' , $ out );
24
- $ this ->assertNotContains (self ::STYLE_STRING , $ out ); // make sure there's no dump header
23
+ $ this ->assertStringContainsString ('magic ' , $ out );
24
+ $ this ->assertStringNotContainsString (self ::STYLE_STRING , $ out ); // make sure there's no dump header
25
25
26
26
// Test that we can capture a variable without rendering into a Data-type variable
27
27
$ data = $ d ->captureVar ('hello ' );
28
- $ this ->assertContains ('hello ' , $ data );
28
+ $ this ->assertStringContainsString ('hello ' , $ data );
29
29
$ deserialized = unserialize ($ data );
30
30
$ this ->assertInstanceOf ('Symfony\Component\VarDumper\Cloner\Data ' , $ deserialized );
31
31
32
32
// Test that we can render the captured variable at a later time
33
33
$ out = $ d ->renderCapturedVar ($ data );
34
- $ this ->assertContains ('hello ' , $ out );
35
- $ this ->assertNotContains (self ::STYLE_STRING , $ out ); // make sure there's no dump header
34
+ $ this ->assertStringContainsString ('hello ' , $ out );
35
+ $ this ->assertStringNotContainsString (self ::STYLE_STRING , $ out ); // make sure there's no dump header
36
36
}
37
37
38
38
public function testSeeking ()
@@ -47,17 +47,17 @@ public function testSeeking()
47
47
48
48
// seek depth of 1
49
49
$ out = $ d ->renderCapturedVar ($ data , array (1 ));
50
- $ this ->assertNotContains ('one ' , $ out );
51
- $ this ->assertContains ('array ' , $ out );
52
- $ this ->assertContains ('two ' , $ out );
53
- $ this ->assertNotContains ('three ' , $ out );
50
+ $ this ->assertStringNotContainsString ('one ' , $ out );
51
+ $ this ->assertStringContainsString ('array ' , $ out );
52
+ $ this ->assertStringContainsString ('two ' , $ out );
53
+ $ this ->assertStringNotContainsString ('three ' , $ out );
54
54
55
55
// seek depth of 2
56
56
$ out = $ d ->renderCapturedVar ($ data , array (1 , 0 ));
57
- $ this ->assertNotContains ('one ' , $ out );
58
- $ this ->assertNotContains ('array ' , $ out );
59
- $ this ->assertContains ('two ' , $ out );
60
- $ this ->assertNotContains ('three ' , $ out );
57
+ $ this ->assertStringNotContainsString ('one ' , $ out );
58
+ $ this ->assertStringNotContainsString ('array ' , $ out );
59
+ $ this ->assertStringContainsString ('two ' , $ out );
60
+ $ this ->assertStringNotContainsString ('three ' , $ out );
61
61
}
62
62
63
63
public function testAssetProvider ()
@@ -73,7 +73,7 @@ public function testAssetProvider()
73
73
$ this ->assertCount (1 , $ inlineHead );
74
74
75
75
$ assetText = $ inlineHead ['html_var_dumper ' ];
76
- $ this ->assertContains (self ::STYLE_STRING , $ assetText );
76
+ $ this ->assertStringContainsString (self ::STYLE_STRING , $ assetText );
77
77
}
78
78
79
79
public function testBasicOptionOperations ()
@@ -108,9 +108,9 @@ public function testBasicOptionOperations()
108
108
109
109
// Test basic get/merge/reset functionality for dumper
110
110
$ options = $ d ->getDumperOptions ();
111
- $ this ->assertContains ('styles ' , $ options );
111
+ $ this ->assertArrayHasKey ('styles ' , $ options );
112
112
$ this ->assertArrayHasKey ('const ' , $ options ['styles ' ]);
113
- $ this ->assertContains ('expanded_depth ' , $ options );
113
+ $ this ->assertArrayHasKey ('expanded_depth ' , $ options );
114
114
$ this ->assertEquals (0 , $ options ['expanded_depth ' ]);
115
115
$ this ->assertCount (2 , $ options );
116
116
@@ -145,53 +145,53 @@ public function testClonerOptions()
145
145
// Test that the 'casters' option can remove default casters
146
146
$ testData = function () {};
147
147
$ d ->resetClonerOptions ();
148
- $ this ->assertContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
148
+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
149
149
150
150
$ d ->resetClonerOptions (array (
151
151
'casters ' => array (),
152
152
));
153
- $ this ->assertNotContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
153
+ $ this ->assertStringNotContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
154
154
155
155
// Test that the 'additional_casters' option can add new casters
156
156
$ testData = function () {};
157
157
$ d ->resetClonerOptions ();
158
- $ this ->assertContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
158
+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
159
159
160
160
$ d ->resetClonerOptions (array (
161
161
'casters ' => array (),
162
162
'additional_casters ' => array ('Closure ' => 'Symfony\Component\VarDumper\Caster\ReflectionCaster::castClosure ' ),
163
163
));
164
- $ this ->assertContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
164
+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
165
165
166
166
// Test 'max_items'
167
167
$ testData = array (array ('one ' , 'two ' , 'three ' , 'four ' , 'five ' ));
168
168
$ d ->resetClonerOptions ();
169
169
$ out = $ d ->renderVar ($ testData );
170
170
foreach ($ testData [0 ] as $ search ) {
171
- $ this ->assertContains ($ search , $ out );
171
+ $ this ->assertStringContainsString ($ search , $ out );
172
172
}
173
173
174
174
$ d ->resetClonerOptions (array (
175
175
'max_items ' => 3 ,
176
176
));
177
177
$ out = $ d ->renderVar ($ testData );
178
- $ this ->assertContains ('one ' , $ out );
179
- $ this ->assertContains ('two ' , $ out );
180
- $ this ->assertContains ('three ' , $ out );
181
- $ this ->assertNotContains ('four ' , $ out );
182
- $ this ->assertNotContains ('five ' , $ out );
178
+ $ this ->assertStringContainsString ('one ' , $ out );
179
+ $ this ->assertStringContainsString ('two ' , $ out );
180
+ $ this ->assertStringContainsString ('three ' , $ out );
181
+ $ this ->assertStringNotContainsString ('four ' , $ out );
182
+ $ this ->assertStringNotContainsString ('five ' , $ out );
183
183
184
184
// Test 'max_string'
185
185
$ testData = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ' ;
186
186
$ d ->resetClonerOptions ();
187
- $ this ->assertContains ($ testData , $ d ->renderVar ($ testData ));
187
+ $ this ->assertStringContainsString ($ testData , $ d ->renderVar ($ testData ));
188
188
189
189
$ d ->resetClonerOptions (array (
190
190
'max_string ' => 10 ,
191
191
));
192
192
$ out = $ d ->renderVar ($ testData );
193
- $ this ->assertContains ('ABCDEFGHIJ ' , $ out );
194
- $ this ->assertNotContains ('ABCDEFGHIJK ' , $ out );
193
+ $ this ->assertStringContainsString ('ABCDEFGHIJ ' , $ out );
194
+ $ this ->assertStringNotContainsString ('ABCDEFGHIJK ' , $ out );
195
195
196
196
// Test 'min_depth' if we are on a Symfony version that supports it
197
197
if (method_exists ('Symfony\Component\VarDumper\Cloner\AbstractCloner ' , 'setMinDepth ' )) {
@@ -201,19 +201,19 @@ public function testClonerOptions()
201
201
));
202
202
$ out = $ d ->renderVar ($ testData );
203
203
foreach ($ testData as $ search ) {
204
- $ this ->assertContains ($ search , $ out );
204
+ $ this ->assertStringContainsString ($ search , $ out );
205
205
}
206
206
207
207
$ d ->resetClonerOptions (array (
208
208
'min_depth ' => 0 ,
209
209
'max_items ' => 3 ,
210
210
));
211
211
$ out = $ d ->renderVar ($ testData );
212
- $ this ->assertContains ('one ' , $ out );
213
- $ this ->assertContains ('two ' , $ out );
214
- $ this ->assertContains ('three ' , $ out );
215
- $ this ->assertNotContains ('four ' , $ out );
216
- $ this ->assertNotContains ('five ' , $ out );
212
+ $ this ->assertStringContainsString ('one ' , $ out );
213
+ $ this ->assertStringContainsString ('two ' , $ out );
214
+ $ this ->assertStringContainsString ('three ' , $ out );
215
+ $ this ->assertStringNotContainsString ('four ' , $ out );
216
+ $ this ->assertStringNotContainsString ('five ' , $ out );
217
217
}
218
218
}
219
219
@@ -225,29 +225,29 @@ public function testDumperOptions()
225
225
// Test that the 'styles' option affects assets
226
226
$ d ->resetDumperOptions ();
227
227
$ assets = $ d ->getAssets ();
228
- $ this ->assertNotContains (self ::STYLE_STRING , $ assets ['inline_head ' ]['html_var_dumper ' ]);
228
+ $ this ->assertStringNotContainsString (self ::STYLE_STRING , $ assets ['inline_head ' ]['html_var_dumper ' ]);
229
229
230
230
$ d ->resetDumperOptions (array ('styles ' => $ this ->testStyles ));
231
231
$ assets = $ d ->getAssets ();
232
- $ this ->assertContains (self ::STYLE_STRING , $ assets ['inline_head ' ]['html_var_dumper ' ]);
232
+ $ this ->assertStringContainsString (self ::STYLE_STRING , $ assets ['inline_head ' ]['html_var_dumper ' ]);
233
233
234
234
// The next tests require changes in Symfony 3.2:
235
235
$ dumpMethod = new \ReflectionMethod ('Symfony\Component\VarDumper\Dumper\HtmlDumper ' , 'dump ' );
236
236
if ($ dumpMethod ->getNumberOfParameters () >= 3 ) {
237
237
// Test that the 'expanded_depth' option affects output
238
238
$ d ->resetDumperOptions (array ('expanded_depth ' => 123321 ));
239
239
$ out = $ d ->renderVar (true );
240
- $ this ->assertContains ('123321 ' , $ out );
240
+ $ this ->assertStringContainsString ('123321 ' , $ out );
241
241
242
242
// Test that the 'max_string' option affects output
243
243
$ d ->resetDumperOptions (array ('max_string ' => 321123 ));
244
244
$ out = $ d ->renderVar (true );
245
- $ this ->assertContains ('321123 ' , $ out );
245
+ $ this ->assertStringContainsString ('321123 ' , $ out );
246
246
247
247
// Test that the 'file_link_format' option affects output
248
248
$ d ->resetDumperOptions (array ('file_link_format ' => 'fmt%ftest ' ));
249
249
$ out = $ d ->renderVar (function () {});
250
- $ this ->assertContains ('DebugBarVarDumperTest.phptest ' , $ out );
250
+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.phptest ' , $ out );
251
251
}
252
252
}
253
253
}
0 commit comments