@@ -117,12 +117,15 @@ public function testWithPluginToolsAddsPluginDirectory(): void
117117 $ this ->assertGreaterThan (1 , count ($ scanDirs ));
118118
119119 // Plugin Tools, Prompts, and Resources paths should be in scan dirs
120- $ pluginSrcPath = dirname (dirname (dirname (__DIR__ ))) . '/src ' ;
121- $ pluginSrcPath = ltrim ($ pluginSrcPath , DIRECTORY_SEPARATOR );
120+ $ pluginSrcPath = dirname (dirname (dirname (__DIR__ )));
121+ // Normalize dirname result to forward slashes first
122+ $ pluginSrcPath = str_replace (DIRECTORY_SEPARATOR , '/ ' , $ pluginSrcPath );
123+ $ pluginSrcPath .= '/src ' ;
124+ $ pluginSrcPath = ltrim ($ pluginSrcPath , '/ ' );
122125
123- $ toolsPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . ' Tools ' ;
124- $ promptsPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . ' Prompts ' ;
125- $ resourcesPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . ' Resources ' ;
126+ $ toolsPath = $ pluginSrcPath . ' / Tools ' ;
127+ $ promptsPath = $ pluginSrcPath . ' / Prompts ' ;
128+ $ resourcesPath = $ pluginSrcPath . ' / Resources ' ;
126129
127130 $ this ->assertContains ($ toolsPath , $ scanDirs );
128131 $ this ->assertContains ($ promptsPath , $ scanDirs );
@@ -140,12 +143,15 @@ public function testWithPluginToolsDoesNotDuplicate(): void
140143 $ builder ->withPluginTools ();
141144
142145 $ scanDirs = $ builder ->getScanDirs ();
143- $ pluginSrcPath = dirname (dirname (dirname (__DIR__ ))) . '/src ' ;
144- $ pluginSrcPath = ltrim ($ pluginSrcPath , DIRECTORY_SEPARATOR );
146+ $ pluginSrcPath = dirname (dirname (dirname (__DIR__ )));
147+ // Normalize dirname result to forward slashes first
148+ $ pluginSrcPath = str_replace (DIRECTORY_SEPARATOR , '/ ' , $ pluginSrcPath );
149+ $ pluginSrcPath .= '/src ' ;
150+ $ pluginSrcPath = ltrim ($ pluginSrcPath , '/ ' );
145151
146- $ toolsPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . ' Tools ' ;
147- $ promptsPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . ' Prompts ' ;
148- $ resourcesPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . ' Resources ' ;
152+ $ toolsPath = $ pluginSrcPath . ' / Tools ' ;
153+ $ promptsPath = $ pluginSrcPath . ' / Prompts ' ;
154+ $ resourcesPath = $ pluginSrcPath . ' / Resources ' ;
149155
150156 // Count occurrences of each path - should be 1 each
151157 $ toolsCount = count (array_filter ($ scanDirs , fn (string $ dir ): bool => $ dir === $ toolsPath ));
@@ -276,12 +282,15 @@ public function testBuildWithPluginTools(): void
276282 $ this ->assertInstanceOf (Server::class, $ server );
277283
278284 // Verify Tools, Prompts, and Resources directories are in scan dirs
279- $ pluginSrcPath = dirname (dirname (dirname (__DIR__ ))) . '/src ' ;
280- $ pluginSrcPath = ltrim ($ pluginSrcPath , DIRECTORY_SEPARATOR );
281-
282- $ toolsPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . 'Tools ' ;
283- $ promptsPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . 'Prompts ' ;
284- $ resourcesPath = $ pluginSrcPath . DIRECTORY_SEPARATOR . 'Resources ' ;
285+ $ pluginSrcPath = dirname (dirname (dirname (__DIR__ )));
286+ // Normalize dirname result to forward slashes first
287+ $ pluginSrcPath = str_replace (DIRECTORY_SEPARATOR , '/ ' , $ pluginSrcPath );
288+ $ pluginSrcPath .= '/src ' ;
289+ $ pluginSrcPath = ltrim ($ pluginSrcPath , '/ ' );
290+
291+ $ toolsPath = $ pluginSrcPath . '/Tools ' ;
292+ $ promptsPath = $ pluginSrcPath . '/Prompts ' ;
293+ $ resourcesPath = $ pluginSrcPath . '/Resources ' ;
285294 $ this ->assertContains ($ toolsPath , $ builder ->getScanDirs ());
286295 $ this ->assertContains ($ promptsPath , $ builder ->getScanDirs ());
287296 $ this ->assertContains ($ resourcesPath , $ builder ->getScanDirs ());
0 commit comments