set('ide-helper', [ 'model_locations' => [ // This is calculated from the base_path() which points to // vendor/orchestra/testbench-core/laravel '/../../../../tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Models', ], ]); } public function test(): void { $actualContent = null; $mockFilesystem = Mockery::mock(Filesystem::class); $mockFilesystem ->shouldReceive('put') ->with( Mockery::any(), Mockery::capture($actualContent) ) ->andReturn(1) // Simulate we wrote _something_ to the file ->once(); $this->instance(Filesystem::class, $mockFilesystem); $command = $this->app->make(ModelsCommand::class); $tester = $this->runCommand($command, [ '--nowrite' => true, ]); $this->assertSame(0, $tester->getStatusCode()); $this->assertEmpty($tester->getDisplay()); $this->assertMatchesPhpSnapshot($actualContent); } }