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 10
10
use Illuminate \Support \Facades \Config ;
11
11
use Illuminate \Support \Facades \Lang ;
12
12
use Illuminate \Support \Facades \Route ;
13
- use Illuminate \Testing \Assert as PHPUnit ;
14
- use Illuminate \Testing \TestResponse ;
15
13
use Orchestra \Testbench \TestCase as BaseTestCase ;
16
14
17
15
abstract class TestCase extends BaseTestCase
@@ -25,13 +23,24 @@ protected function setUp(): void
25
23
{
26
24
parent ::setUp ();
27
25
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
+ }
32
43
33
- return $ this ;
34
- });
35
44
}
36
45
37
46
/**
You can’t perform that action at this time.
0 commit comments