polishsymfonycommunity/symfony2-mocker-extension
Behat extension for Symfony2 that lets you mock services in the dependency injection container during tests. Built on Mockery and SymfonyMockerContainer. Consider it a hack and use sparingly; alternative: TestDoubleBundle.
Mockery facade or phpunit/mock-objects). No added value here.ContainerInterface. Direct integration would require:
partialMock, createMock, or Mockery).Testing facade for HTTP-based mocking (e.g., Http::fake()).orchestra/testbench (for testing packages in isolation).Mockery, PHPUnit, or PestPHP?ServiceContainerMock trait) achieve the same goal with less risk?TestDoubleBundle (the recommended alternative)?
PHPUnit + Mockery/phpunit/mock-objects.PestPHP or Laravel Dusk.orchestra/testbench.Http::fake(), Route::fake().partialMock or interface-based dependencies.// Instead of Symfony2MockerExtension:
$mockService = Mockery::mock(Service::class);
$this->app->instance(Service::class, $mockService);
Http::fake() for HTTP-related tests.DatabaseMigrations or DatabaseTransactions for DB tests.SymfonyMockerContainer, but document this as technical debt.ContainerInterface ≠ Laravel’s Illuminate\Contracts\Container\Container.setUp():
public function setUp(): void
{
$this->app->instance(MyService::class, Mockery::mock(MyService::class));
}
MockContainer trait).ClassNotFoundException or BindingResolutionException due to Laravel/Symfony2 DI differences.How can I help you explore Laravel packages today?