@@ -44,13 +44,6 @@ protected function setUp(): void {
4444 $ this ->output = $ this ->createMock (OutputInterface::class);
4545 }
4646
47- /**
48- * Helper method to execute the command using reflection since execute() is protected
49- */
50- private function executeCommand (): int {
51- return self ::invokePrivate ($ this ->command , 'execute ' , [$ this ->input , $ this ->output ]);
52- }
53-
5447 public function testExecuteSuccessfulDelegation (): void {
5548 $ settingClass = \OCA \Settings \Settings \Admin \Server::class;
5649 $ groupId = 'testgroup ' ;
@@ -79,7 +72,7 @@ public function testExecuteSuccessfulDelegation(): void {
7972 ->with ($ groupId , $ settingClass )
8073 ->willReturn ($ authorizedGroup );
8174
82- $ result = $ this ->executeCommand ( );
75+ $ result = $ this ->command -> execute ( $ this -> input , $ this -> output );
8376
8477 $ this ->assertEquals (0 , $ result );
8578 }
@@ -93,7 +86,7 @@ public function testExecuteInvalidSettingClass(): void {
9386 ->with ('settingClass ' )
9487 ->willReturn ($ settingClass );
9588
96- $ result = $ this ->executeCommand ( );
89+ $ result = $ this ->command -> execute ( $ this -> input , $ this -> output );
9790
9891 // Should return exit code 2 for invalid setting class
9992 $ this ->assertEquals (2 , $ result );
@@ -116,7 +109,7 @@ public function testExecuteNonExistentGroup(): void {
116109 ->with ($ groupId )
117110 ->willReturn (false );
118111
119- $ result = $ this ->executeCommand ( );
112+ $ result = $ this ->command -> execute ( $ this -> input , $ this -> output );
120113
121114 // Should return exit code 3 for non-existent group
122115 $ this ->assertEquals (3 , $ result );
0 commit comments