artisan('make:crud', ['name' => $this->model_name, '--no-interaction' => true]); $modelFactoryPath = database_path('factories/'.$this->model_name.'Factory.php'); $this->assertFileExists($modelFactoryPath); $modelFactoryContent = "full_model_name}; use Illuminate\Database\Eloquent\Factories\Factory; class {$this->model_name}Factory extends Factory { protected \$model = {$this->model_name}::class; public function definition() { return [ 'name' => \$this->faker->word, 'description' => \$this->faker->sentence, 'creator_id' => function () { return User::factory()->create()->id; }, ]; } } "; $this->assertEquals($modelFactoryContent, file_get_contents($modelFactoryPath)); } }