File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ composer.lock
1111* .swp
1212* .swo
1313.DS_Store
14+ .phpunit.result.cache
Original file line number Diff line number Diff line change @@ -284,8 +284,19 @@ public function testValidateFailed()
284284 ->validate ([], false );
285285 $ out = ob_get_clean ();
286286
287- $ this ->assertStringContainsString ('use when pre-check ' , $ out );
288- $ this ->assertStringContainsString ('use custom validate ' , $ out );
287+ $ needle = 'use when pre-check ' ;
288+ if (\version_compare (\PHPUnit \Runner \Version::id (), '7.0.0 ' , '< ' ) ) {
289+ $ this ->assertContains ($ needle , $ out );
290+ } else {
291+ $ this ->assertStringContainsString ($ needle , $ out );
292+ }
293+
294+ $ needle = 'use custom validate ' ;
295+ if (\version_compare (\PHPUnit \Runner \Version::id (), '7.0.0 ' , '< ' ) ) {
296+ $ this ->assertContains ($ needle , $ out );
297+ } else {
298+ $ this ->assertStringContainsString ($ needle , $ out );
299+ }
289300
290301 $ this ->assertFalse ($ v ->isOk ());
291302 $ this ->assertTrue ($ v ->failed ());
Original file line number Diff line number Diff line change 1010
1111use Inhere \Validate \Validator \Messages ;
1212use PHPUnit \Framework \TestCase ;
13+ use PHPUnit \Runner \Version ;
1314
1415/**
1516 * Class MessagesTest
@@ -30,6 +31,12 @@ public function testBasic()
3031 $ this ->assertTrue (Messages::has ('key1 ' ));
3132 $ this ->assertFalse (Messages::has ('key3 ' ));
3233
33- $ this ->assertContains ('validation is not through! ' , Messages::getDefault ());
34+ $ needle = 'validation is not through! ' ;
35+
36+ if (\version_compare (Version::id (), '7.0.0 ' , '< ' ) ) {
37+ $ this ->assertContains ($ needle , Messages::getDefault ());
38+ } else {
39+ $ this ->assertStringContainsString ($ needle , Messages::getDefault ());
40+ }
3441 }
3542}
You can’t perform that action at this time.
0 commit comments