Skip to content

Commit

Permalink
Revert "Revert "Fix: conversionsApiPageView directive not executing r…
Browse files Browse the repository at this point in the history
…equest""

This reverts commit a1482d2.
  • Loading branch information
jordyvanderhaegen committed Nov 18, 2021
1 parent 8d986ef commit 4c401b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/ConversionsApiServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Esign\ConversionsApi;

use Esign\ConversionsApi\Facades\ConversionsApi as ConversionsApiFacade;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

Expand Down Expand Up @@ -30,7 +29,7 @@ protected function registerBladeDirectives(): void
return "<?php echo view('conversions-api::data-layer'); ?>";
});
Blade::directive('conversionsApiPageView', function () {
ConversionsApiFacade::executePageViewEvent();
return "<?php app(\Esign\\ConversionsApi\\ConversionsApi::class)->executePageViewEvent(); ?>";
});
}

Expand Down
6 changes: 4 additions & 2 deletions tests/ConversionsApiViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<?php app(\Esign\\ConversionsApi\\ConversionsApi::class)->executePageViewEvent(); ?>',
Blade::compileString('@conversionsApiPageView'),
);
}

/** @test */
Expand Down

0 comments on commit 4c401b5

Please sign in to comment.