99use PHPUnit \Framework \TestCase ;
1010use tests \classes \NoExitInteractor ;
1111
12- class AiGenerateInstructionsCommandTest extends TestCase
13- {
12+ class AiGenerateInstructionsCommandTest extends TestCase {
1413 protected static $ in ;
1514 protected static $ ou ;
1615 protected $ baseDir ;
1716
18- public function setUp (): void
19- {
17+ public function setUp (): void {
2018 self ::$ in = __DIR__ . DIRECTORY_SEPARATOR . 'input.test ' . uniqid ('' , true ) . '.txt ' ;
2119 self ::$ ou = __DIR__ . DIRECTORY_SEPARATOR . 'output.test ' . uniqid ('' , true ) . '.txt ' ;
2220 file_put_contents (self ::$ in , '' );
@@ -27,8 +25,7 @@ public function setUp(): void
2725 }
2826 }
2927
30- public function tearDown (): void
31- {
28+ public function tearDown (): void {
3229 if (file_exists (self ::$ in )) {
3330 unlink (self ::$ in );
3431 }
@@ -38,8 +35,7 @@ public function tearDown(): void
3835 $ this ->recursiveRmdir ($ this ->baseDir );
3936 }
4037
41- protected function recursiveRmdir ($ dir )
42- {
38+ protected function recursiveRmdir ($ dir ) {
4339 if (!is_dir ($ dir )) {
4440 return ;
4541 }
@@ -50,8 +46,7 @@ protected function recursiveRmdir($dir)
5046 return rmdir ($ dir );
5147 }
5248
53- protected function newApp ($ command ): Application
54- {
49+ protected function newApp ($ command ): Application {
5550 $ app = new Application ('test ' , '0.0.1 ' , function ($ exitCode ) {
5651 return $ exitCode ;
5752 });
@@ -60,13 +55,11 @@ protected function newApp($command): Application
6055 return $ app ;
6156 }
6257
63- protected function setInput (array $ lines ): void
64- {
58+ protected function setInput (array $ lines ): void {
6559 file_put_contents (self ::$ in , implode ("\n" , $ lines ) . "\n" );
6660 }
6761
68- protected function setProjectRoot ($ command , $ path )
69- {
62+ protected function setProjectRoot ($ command , $ path ) {
7063 $ reflection = new \ReflectionClass (get_class ($ command ));
7164 $ property = null ;
7265 $ currentClass = $ reflection ;
@@ -78,13 +71,11 @@ protected function setProjectRoot($command, $path)
7871 }
7972 }
8073 if ($ property ) {
81- $ property ->setAccessible (true );
8274 $ property ->setValue ($ command , $ path );
8375 }
8476 }
8577
86- public function testFailsIfAiConfigMissing ()
87- {
78+ public function testFailsIfAiConfigMissing () {
8879 $ this ->setInput ([
8980 'desc ' ,
9081 'none ' ,
@@ -112,8 +103,7 @@ public function testFailsIfAiConfigMissing()
112103 $ this ->assertStringContainsString ('Missing AI configuration ' , file_get_contents (self ::$ ou ));
113104 }
114105
115- public function testWritesInstructionsToFiles ()
116- {
106+ public function testWritesInstructionsToFiles () {
117107 $ creds = [
118108 'api_key ' => 'key ' ,
119109 'model ' => 'gpt-4o ' ,
@@ -160,8 +150,7 @@ public function testWritesInstructionsToFiles()
160150 $ this ->assertFileExists ($ this ->baseDir . '.windsurfrules ' );
161151 }
162152
163- public function testNoInstructionsReturnedFromLlm ()
164- {
153+ public function testNoInstructionsReturnedFromLlm () {
165154 $ creds = [
166155 'api_key ' => 'key ' ,
167156 'model ' => 'gpt-4o ' ,
@@ -203,8 +192,7 @@ public function testNoInstructionsReturnedFromLlm()
203192 $ this ->assertSame (1 , $ result );
204193 }
205194
206- public function testLlmApiCallFails ()
207- {
195+ public function testLlmApiCallFails () {
208196 $ creds = [
209197 'api_key ' => 'key ' ,
210198 'model ' => 'gpt-4o ' ,
@@ -242,8 +230,7 @@ public function testLlmApiCallFails()
242230 $ this ->assertSame (1 , $ result );
243231 }
244232
245- public function testUsesDeprecatedConfigFile ()
246- {
233+ public function testUsesDeprecatedConfigFile () {
247234 $ creds = [
248235 'ai ' => [
249236 'api_key ' => 'key ' ,
0 commit comments