From 5c0aa9ae9cb4bf5323bea13c284e2db0e2b86f2a Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Tue, 26 Dec 2023 07:19:02 -0500 Subject: [PATCH] Add test --- tests/Feature/RunTest.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/Feature/RunTest.php b/tests/Feature/RunTest.php index 1251836..aed86ee 100755 --- a/tests/Feature/RunTest.php +++ b/tests/Feature/RunTest.php @@ -72,3 +72,38 @@ class Foo { protected \$bar; public function baz() {} } ] ]); + +it('fixes specific files', function (string $before, string $after) { + File::makeDirectory($dir = stubsPath('vendor/foo/bar'), recursive: true, force: true); + File::put($foo = stubsPath('vendor/foo/bar/Foo.php'), $before); + File::put($bar = stubsPath('vendor/foo/bar/Bar.php'), $before); + + $this->artisan('run', [ + 'paths' => [$foo, $bar], + '--dir' => stubsPath(), + '--annotate' => 'internal', + '--methods' => 'public', + '--properties' => 'protected', + ])->assertSuccessful(); + + expect(File::get($foo))->toEqual($after); + expect(File::get($bar))->toEqual($after); + + File::delete($dir); +})->with([ + [ + <<