@@ -13,6 +13,11 @@ protected function configure()
1313 {
1414 $ this ->setName ('check ' )
1515 ->addOption ('report ' , null , InputOption::VALUE_NONE )
16+ ->addOption ('coverage-text ' , null , InputOption::VALUE_NONE , 'Display coverage info? ' )
17+ ->addOption ('coverage-html ' , null , InputOption::VALUE_OPTIONAL , 'Save coverage info as HTML? ' , false )
18+ ->addOption ('coverage-clover ' , null , InputOption::VALUE_OPTIONAL , 'Save coverage info as XML? ' , false )
19+ ->addOption ('group ' , null , InputOption::VALUE_OPTIONAL , 'Excute only a tests group? ' , false )
20+ ->addOption ('ignore-tests ' , null , InputOption::VALUE_NONE )
1621 ->setDescription ('Runs all necessary checks. ' )
1722 ->setHelp ('Runs all necessary checks ' );
1823 }
@@ -22,10 +27,28 @@ protected function execute(InputInterface $input, OutputInterface $output)
2227 $ app = $ this ->getApplication ();
2328 $ coverageFilePath = $ app ->getWorkingDirectory ().'/coverage.xml ' ;
2429
25- if (( $ code = $ app -> runCommand ( ' unit-tests:run ' , $ output , [
30+ $ args = [
2631 '--coverage-text ' => true ,
2732 '--coverage-clover ' => $ coverageFilePath ,
28- ])) !== 0 ) {
33+ ];
34+
35+ if ($ input ->getOption ('coverage-text ' )) {
36+ $ args [] = '--coverage-text ' ;
37+ }
38+
39+ if ($ path = $ input ->getOption ('coverage-clover ' )) {
40+ $ args ['--coverage-clover ' ] = $ path ;
41+ }
42+
43+ if ($ path = $ input ->getOption ('coverage-html ' )) {
44+ $ args ['--coverage-html ' ] = $ path ;
45+ }
46+
47+ if ($ group = $ input ->getOption ('group ' )) {
48+ $ args ['--group ' ] = $ group ;
49+ }
50+
51+ if (($ code = $ app ->runCommand ('unit-tests:run ' , $ output , $ args )) !== 0 ) {
2952 return $ code ;
3053 }
3154
@@ -48,6 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4871
4972 if (version_compare (PHP_VERSION , '5.6.0 ' ) >= 0 && ($ code = $ app ->runCommand ('code-style:check ' , $ output , [
5073 '--no-interaction ' ,
74+ '--ignore-tests ' => $ input ->getOption ('ignore-tests ' ),
5175 ])) !== 0 ) {
5276 return $ code ;
5377 }
0 commit comments