@@ -20,19 +20,19 @@ public function testBasicFunctionality()
2020 $ d ->mergeDumperOptions (array ('styles ' => $ this ->testStyles ));
2121 $ out = $ d ->renderVar ('magic ' );
2222
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
2525
2626 // Test that we can capture a variable without rendering into a Data-type variable
2727 $ data = $ d ->captureVar ('hello ' );
28- $ this ->assertContains ('hello ' , $ data );
28+ $ this ->assertStringContainsString ('hello ' , $ data );
2929 $ deserialized = unserialize ($ data );
3030 $ this ->assertInstanceOf ('Symfony\Component\VarDumper\Cloner\Data ' , $ deserialized );
3131
3232 // Test that we can render the captured variable at a later time
3333 $ 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
3636 }
3737
3838 public function testSeeking ()
@@ -47,17 +47,17 @@ public function testSeeking()
4747
4848 // seek depth of 1
4949 $ 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 );
5454
5555 // seek depth of 2
5656 $ 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 );
6161 }
6262
6363 public function testAssetProvider ()
@@ -73,7 +73,7 @@ public function testAssetProvider()
7373 $ this ->assertCount (1 , $ inlineHead );
7474
7575 $ assetText = $ inlineHead ['html_var_dumper ' ];
76- $ this ->assertContains (self ::STYLE_STRING , $ assetText );
76+ $ this ->assertStringContainsString (self ::STYLE_STRING , $ assetText );
7777 }
7878
7979 public function testBasicOptionOperations ()
@@ -108,9 +108,9 @@ public function testBasicOptionOperations()
108108
109109 // Test basic get/merge/reset functionality for dumper
110110 $ options = $ d ->getDumperOptions ();
111- $ this ->assertContains ('styles ' , $ options );
111+ $ this ->assertArrayHasKey ('styles ' , $ options );
112112 $ this ->assertArrayHasKey ('const ' , $ options ['styles ' ]);
113- $ this ->assertContains ('expanded_depth ' , $ options );
113+ $ this ->assertArrayHasKey ('expanded_depth ' , $ options );
114114 $ this ->assertEquals (0 , $ options ['expanded_depth ' ]);
115115 $ this ->assertCount (2 , $ options );
116116
@@ -145,53 +145,53 @@ public function testClonerOptions()
145145 // Test that the 'casters' option can remove default casters
146146 $ testData = function () {};
147147 $ d ->resetClonerOptions ();
148- $ this ->assertContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
148+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
149149
150150 $ d ->resetClonerOptions (array (
151151 'casters ' => array (),
152152 ));
153- $ this ->assertNotContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
153+ $ this ->assertStringNotContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
154154
155155 // Test that the 'additional_casters' option can add new casters
156156 $ testData = function () {};
157157 $ d ->resetClonerOptions ();
158- $ this ->assertContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
158+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
159159
160160 $ d ->resetClonerOptions (array (
161161 'casters ' => array (),
162162 'additional_casters ' => array ('Closure ' => 'Symfony\Component\VarDumper\Caster\ReflectionCaster::castClosure ' ),
163163 ));
164- $ this ->assertContains ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
164+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.php ' , $ d ->renderVar ($ testData ));
165165
166166 // Test 'max_items'
167167 $ testData = array (array ('one ' , 'two ' , 'three ' , 'four ' , 'five ' ));
168168 $ d ->resetClonerOptions ();
169169 $ out = $ d ->renderVar ($ testData );
170170 foreach ($ testData [0 ] as $ search ) {
171- $ this ->assertContains ($ search , $ out );
171+ $ this ->assertStringContainsString ($ search , $ out );
172172 }
173173
174174 $ d ->resetClonerOptions (array (
175175 'max_items ' => 3 ,
176176 ));
177177 $ 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 );
183183
184184 // Test 'max_string'
185185 $ testData = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ' ;
186186 $ d ->resetClonerOptions ();
187- $ this ->assertContains ($ testData , $ d ->renderVar ($ testData ));
187+ $ this ->assertStringContainsString ($ testData , $ d ->renderVar ($ testData ));
188188
189189 $ d ->resetClonerOptions (array (
190190 'max_string ' => 10 ,
191191 ));
192192 $ out = $ d ->renderVar ($ testData );
193- $ this ->assertContains ('ABCDEFGHIJ ' , $ out );
194- $ this ->assertNotContains ('ABCDEFGHIJK ' , $ out );
193+ $ this ->assertStringContainsString ('ABCDEFGHIJ ' , $ out );
194+ $ this ->assertStringNotContainsString ('ABCDEFGHIJK ' , $ out );
195195
196196 // Test 'min_depth' if we are on a Symfony version that supports it
197197 if (method_exists ('Symfony\Component\VarDumper\Cloner\AbstractCloner ' , 'setMinDepth ' )) {
@@ -201,19 +201,19 @@ public function testClonerOptions()
201201 ));
202202 $ out = $ d ->renderVar ($ testData );
203203 foreach ($ testData as $ search ) {
204- $ this ->assertContains ($ search , $ out );
204+ $ this ->assertStringContainsString ($ search , $ out );
205205 }
206206
207207 $ d ->resetClonerOptions (array (
208208 'min_depth ' => 0 ,
209209 'max_items ' => 3 ,
210210 ));
211211 $ 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 );
217217 }
218218 }
219219
@@ -225,29 +225,29 @@ public function testDumperOptions()
225225 // Test that the 'styles' option affects assets
226226 $ d ->resetDumperOptions ();
227227 $ 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 ' ]);
229229
230230 $ d ->resetDumperOptions (array ('styles ' => $ this ->testStyles ));
231231 $ 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 ' ]);
233233
234234 // The next tests require changes in Symfony 3.2:
235235 $ dumpMethod = new \ReflectionMethod ('Symfony\Component\VarDumper\Dumper\HtmlDumper ' , 'dump ' );
236236 if ($ dumpMethod ->getNumberOfParameters () >= 3 ) {
237237 // Test that the 'expanded_depth' option affects output
238238 $ d ->resetDumperOptions (array ('expanded_depth ' => 123321 ));
239239 $ out = $ d ->renderVar (true );
240- $ this ->assertContains ('123321 ' , $ out );
240+ $ this ->assertStringContainsString ('123321 ' , $ out );
241241
242242 // Test that the 'max_string' option affects output
243243 $ d ->resetDumperOptions (array ('max_string ' => 321123 ));
244244 $ out = $ d ->renderVar (true );
245- $ this ->assertContains ('321123 ' , $ out );
245+ $ this ->assertStringContainsString ('321123 ' , $ out );
246246
247247 // Test that the 'file_link_format' option affects output
248248 $ d ->resetDumperOptions (array ('file_link_format ' => 'fmt%ftest ' ));
249249 $ out = $ d ->renderVar (function () {});
250- $ this ->assertContains ('DebugBarVarDumperTest.phptest ' , $ out );
250+ $ this ->assertStringContainsString ('DebugBarVarDumperTest.phptest ' , $ out );
251251 }
252252 }
253253}
0 commit comments