File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace Inertia \Tests ;
4
4
5
5
use Illuminate \Filesystem \Filesystem ;
6
+ use Illuminate \Support \Facades \Blade ;
6
7
use Illuminate \Support \Facades \Config ;
7
8
use Illuminate \View \Compilers \BladeCompiler ;
8
9
use Illuminate \View \Engines \PhpEngine ;
@@ -50,6 +51,11 @@ protected function tearDown(): void
50
51
51
52
protected function renderView ($ contents , $ data = [])
52
53
{
54
+ // Laravel 8+ only: https://github.com/laravel/framework/pull/40425
55
+ if (method_exists (BladeCompiler::class, 'render ' )) {
56
+ return Blade::render ($ contents , $ data , false );
57
+ }
58
+
53
59
// First, we'll create a temporary file, and use compileString to 'emulate' compilation of our view.
54
60
// This skips caching, and a bunch of other logic that's not relevant for what we need here.
55
61
$ path = tempnam (sys_get_temp_dir (), 'inertia_tests_render_ ' );
You can’t perform that action at this time.
0 commit comments