@@ -480,6 +480,37 @@ public function testGetPullRequest(): void
480480 $ this ->vcsAdapter ->deleteRepository (static ::$ owner , $ repositoryName );
481481 }
482482
483+ public function testGetPullRequestFiles (): void
484+ {
485+ $ repositoryName = 'test-get-pull-request-files- ' . \uniqid ();
486+ $ this ->vcsAdapter ->createRepository (self ::$ owner , $ repositoryName , false );
487+
488+ $ this ->vcsAdapter ->createFile (self ::$ owner , $ repositoryName , 'README.md ' , '# Test ' );
489+ $ this ->vcsAdapter ->createBranch (self ::$ owner , $ repositoryName , 'feature-branch ' , static ::$ defaultBranch );
490+ $ this ->vcsAdapter ->createFile (self ::$ owner , $ repositoryName , 'feature.txt ' , 'feature content ' , 'Add feature ' , 'feature-branch ' );
491+
492+ $ pr = $ this ->vcsAdapter ->createPullRequest (
493+ self ::$ owner ,
494+ $ repositoryName ,
495+ 'Test PR Files ' ,
496+ 'feature-branch ' ,
497+ static ::$ defaultBranch
498+ );
499+
500+ $ prNumber = $ pr ['number ' ] ?? 0 ;
501+ $ this ->assertGreaterThan (0 , $ prNumber );
502+
503+ $ result = $ this ->vcsAdapter ->getPullRequestFiles (self ::$ owner , $ repositoryName , $ prNumber );
504+
505+ $ this ->assertIsArray ($ result );
506+ $ this ->assertNotEmpty ($ result );
507+
508+ $ filenames = array_column ($ result , 'filename ' );
509+ $ this ->assertContains ('feature.txt ' , $ filenames );
510+
511+ $ this ->vcsAdapter ->deleteRepository (self ::$ owner , $ repositoryName );
512+ }
513+
483514 public function testGetPullRequestWithInvalidNumber (): void
484515 {
485516 $ repositoryName = 'test-get-pull-request-invalid- ' . \uniqid ();
0 commit comments