1414namespace Ecommit \DeployRsyncBundle \Tests \Command ;
1515
1616use Ecommit \DeployRsyncBundle \Command \DeployRsyncCommand ;
17+ use Ecommit \DeployRsyncBundle \DependencyInjection \Configuration ;
1718use PHPUnit \Framework \TestCase ;
1819use Symfony \Component \Console \Application ;
1920use Symfony \Component \Console \Exception \RuntimeException ;
2021use Symfony \Component \Console \Tester \CommandTester ;
2122use Symfony \Component \Process \Process ;
2223
24+ /**
25+ * @phpstan-import-type ProcessedConfiguration from Configuration
26+ */
2327class DeployRsyncCommandTest extends TestCase
2428{
2529 /**
@@ -437,7 +441,7 @@ protected function createCommandTester(array $config, array $expectedCommand, bo
437441 ->getMock ();
438442
439443 if (\count ($ expectedCommand ) > 0 ) {
440- $ command ->expects ($ this ->once ())->method ('createProcess ' )->with ($ expectedCommand )->willReturnCallback (function ($ command ) use ($ isSuccessful ) {
444+ $ command ->expects ($ this ->once ())->method ('createProcess ' )->with ($ expectedCommand )->willReturnCallback (function ($ command ) use ($ isSuccessful ) { // @phpstan-ignore-line
441445 $ process = $ this ->getMockBuilder (Process::class)
442446 ->setConstructorArgs ([$ command ])
443447 ->onlyMethods (['start ' , 'getIterator ' , 'isSuccessful ' ])
@@ -454,7 +458,7 @@ protected function createCommandTester(array $config, array $expectedCommand, bo
454458 return $ process ;
455459 });
456460 } else {
457- $ command ->expects ($ this ->never ())->method ('createProcess ' );
461+ $ command ->expects ($ this ->never ())->method ('createProcess ' ); // @phpstan-ignore-line
458462 }
459463
460464 $ command ->setName ('ecommit:deploy-rsync ' );
@@ -469,6 +473,9 @@ protected function createCommandTester(array $config, array $expectedCommand, bo
469473 return new CommandTester ($ application ->find ('ecommit:deploy-rsync ' ));
470474 }
471475
476+ /**
477+ * @return ProcessedConfiguration
478+ */
472479 protected function getDefaultConfig (): array
473480 {
474481 return [
@@ -486,7 +493,7 @@ protected function getDefaultConfig(): array
486493 'rsync ' => [
487494 'rsync_path ' => 'rsync ' ,
488495 'rsync_options ' => ['-azC ' , '--force ' , '--delete ' , '--progress ' ],
489- 'ignore_file ' => realpath (__DIR__ .'/../ignore_file.txt ' ),
496+ 'ignore_file ' => ( string ) realpath (__DIR__ .'/../ignore_file.txt ' ),
490497 ],
491498 ];
492499 }
0 commit comments