File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change 1010use Illuminate \Support \Facades \Config ;
1111use Illuminate \Support \Facades \Lang ;
1212use Illuminate \Support \Facades \Route ;
13- use Illuminate \Testing \Assert as PHPUnit ;
14- use Illuminate \Testing \TestResponse ;
1513use Orchestra \Testbench \TestCase as BaseTestCase ;
1614
1715abstract class TestCase extends BaseTestCase
@@ -25,13 +23,24 @@ protected function setUp(): void
2523 {
2624 parent ::setUp ();
2725
28- TestResponse::macro ('assertResponseHasNoView ' , function () {
29- if (isset ($ this ->original ) && $ this ->original instanceof View) {
30- PHPUnit::fail ('The response has a view. ' );
31- }
26+ if ($ this ->app ->version () < 7 ) {
27+ \Illuminate \Foundation \Testing \TestResponse::macro ('assertResponseHasNoView ' , function () {
28+ if (isset ($ this ->original ) && $ this ->original instanceof View) {
29+ Illuminate \Foundation \Testing \Assert::fail ('The response has a view. ' );
30+ }
31+
32+ return $ this ;
33+ });
34+ } else {
35+ \Illuminate \Testing \TestResponse::macro ('assertResponseHasNoView ' , function () {
36+ if (isset ($ this ->original ) && $ this ->original instanceof View) {
37+ Illuminate \Testing \Assert::fail ('The response has a view. ' );
38+ }
39+
40+ return $ this ;
41+ });
42+ }
3243
33- return $ this ;
34- });
3544 }
3645
3746 /**
You can’t perform that action at this time.
0 commit comments