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