File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 44
55use CodeZero \LocalizedRoutes \LocalizedRoutesServiceProvider ;
66use CodeZero \Localizer \LocalizerServiceProvider ;
7+ use Illuminate \Contracts \View \View ;
8+ use Illuminate \Foundation \Testing \Assert as PHPUnit ;
9+ use Illuminate \Foundation \Testing \TestResponse ;
710use Illuminate \Support \Collection ;
811use Illuminate \Support \Facades \App ;
912use Illuminate \Support \Facades \Config ;
1215
1316abstract class TestCase extends BaseTestCase
1417{
18+ /**
19+ * Setup the test environment.
20+ *
21+ * @return void
22+ */
23+ protected function setUp (): void
24+ {
25+ parent ::setUp ();
26+
27+ TestResponse::macro ('assertResponseHasNoView ' , function () {
28+ if (isset ($ this ->original ) && $ this ->original instanceof View) {
29+ return PHPUnit::fail ('The response has a view. ' );
30+ }
31+
32+ return $ this ;
33+ });
34+ }
35+
1536 /**
1637 * Set the app locale.
1738 *
You can’t perform that action at this time.
0 commit comments