diff --git a/tests/Feature/Sortable/SortableExtensionTest.php b/tests/Feature/Sortable/SortableExtensionTest.php new file mode 100644 index 0000000..b45ae6a --- /dev/null +++ b/tests/Feature/Sortable/SortableExtensionTest.php @@ -0,0 +1,23 @@ +addSubscribers( + $this->evm, + $this->em, + ); + + $this->assertEmpty($extension->getFilters()); + } +} diff --git a/tests/Feature/Translatable/TranslatableExtensionTest.php b/tests/Feature/Translatable/TranslatableExtensionTest.php index 604af52..55dfb17 100644 --- a/tests/Feature/Translatable/TranslatableExtensionTest.php +++ b/tests/Feature/Translatable/TranslatableExtensionTest.php @@ -4,36 +4,19 @@ namespace LaravelDoctrineTest\Extensions\Feature\Translatable; -use Illuminate\Contracts\Config\Repository; -use Illuminate\Contracts\Events\Dispatcher; -use Illuminate\Contracts\Foundation\Application; use LaravelDoctrine\Extensions\Translatable\TranslatableExtension; use LaravelDoctrineTest\Extensions\Feature\TestCase; -use Mockery as m; + +use function app; class TranslatableExtensionTest extends TestCase { public function testCanRegisterExtension(): void { - $app = m::mock(Application::class); - $app->shouldReceive('getLocale')->once()->andReturn('en'); - - $config = m::mock(Repository::class); - $config->shouldReceive('get') - ->with('app.locale')->once() - ->andReturn('en'); - - $events = m::mock(Dispatcher::class); - $events->shouldReceive('listen') - ->with('locale.changed', m::type('callable')) - ->once(); - - $extension = new TranslatableExtension($app, $config, $events); + $extension = app(TranslatableExtension::class); + $extension->addSubscribers($this->evm, $this->em); - $extension->addSubscribers( - $this->evm, - $this->em, - ); + $this->app['events']->dispatch('locale.changed', ['en']); $this->assertEmpty($extension->getFilters()); }