symfony/console).DatabaseSeeder but offers more granular control (e.g., relationships, sequences).AppKernel environment checks), reducing risk of production contamination.EntityManager interface).kernel.test). Laravel’s events system is similar but not identical; may need event listener bridges.ContainerInterface vs. Laravel’s Container.Blueprint::register(), which may clash with Laravel’s Blueprint (e.g., migrations).Kernel and TestCase; Laravel uses PHPUnit with Illuminate\Foundation\Testing.DatabaseSeeder/Factories?Console, EventDispatcher) for this use case?fzaninotto/Faker, Laravel’s Factory, or spatie/laravel-test-factories)?eloquent is not ORM-compliant; requires Doctrine DBAL or a bridge like laravel-doctrine).symfony/console (for CLI commands, if used).symfony/event-dispatcher (if leveraging events).create()): Simpler but less control over relationships.spatie/laravel-doctrine-orm).ContainerInterface to Laravel’s container.Blueprint::register() → BlueprintService::register()).TestCase to load the bundle in setUp().use Dakatsuka\BlueprintBundle\Blueprint;
use Symfony\Component\HttpKernel\KernelInterface;
class TestCase extends \Tests\TestCase {
protected function setUp(): void {
parent::setUp();
$kernel = $this->app->make(KernelInterface::class);
$kernel->boot();
Blueprint::register(...); // Use adapter
}
}
AppKernel logic to check Laravel’s environment (e.g., app()->environment('testing')).'aliases' => [
'Blueprint' => Dakatsuka\BlueprintBundle\Adapter\LaravelBlueprint::class,
],
TestCase).Container vs. Laravel’s Container.Kernel, EventDispatcher, and Container.How can I help you explore Laravel packages today?