diff --git a/src/ConversionsApiServiceProvider.php b/src/ConversionsApiServiceProvider.php index 4e972d1..da9de6e 100644 --- a/src/ConversionsApiServiceProvider.php +++ b/src/ConversionsApiServiceProvider.php @@ -2,7 +2,6 @@ namespace Esign\ConversionsApi; -use Esign\ConversionsApi\Facades\ConversionsApi as ConversionsApiFacade; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; @@ -30,7 +29,7 @@ protected function registerBladeDirectives(): void return ""; }); Blade::directive('conversionsApiPageView', function () { - ConversionsApiFacade::executePageViewEvent(); + return "executePageViewEvent(); ?>"; }); } diff --git a/tests/ConversionsApiViewTest.php b/tests/ConversionsApiViewTest.php index 850a2f9..ce761f5 100644 --- a/tests/ConversionsApiViewTest.php +++ b/tests/ConversionsApiViewTest.php @@ -10,8 +10,10 @@ class ConversionsApiViewTest extends TestCase /** @test */ public function it_can_render_the_conversions_api_page_view_directive() { - ConversionsApi::shouldReceive('executePageViewEvent')->once(); - Blade::compileString('@conversionsApiPageView'); + $this->assertSame( + 'executePageViewEvent(); ?>', + Blade::compileString('@conversionsApiPageView'), + ); } /** @test */