cwd = getcwd(); } protected function tearDown(): void { chdir($this->cwd); parent::tearDown(); } public function test(): void { $command = $this->app->make(ModelsCommand::class); chdir(__DIR__); $tester = $this->runCommand($command, [ '--dir' => ['Services/*/Models'], '--write' => true, ]); $this->assertSame(0, $tester->getStatusCode()); $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); $this->assertMatchesMockedSnapshot(); } }