Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 10
TestCommand
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 10
 configure
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 execute
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 8
<?php
    
namespace Eywa\Console\App
{
    use Eywa\Console\Shell;
    use Symfony\Component\Console\Command\Command;
    use Symfony\Component\Console\Input\InputInterface;
    use Symfony\Component\Console\Output\OutputInterface;
    use Symfony\Component\Console\Style\SymfonyStyle;
    class TestCommand extends Command
    {
        protected static $defaultName = 'app:test';
            
        protected function configure(): void
        {
            $this->setDescription('Test the application');
        }
            
        public function execute(InputInterface $input, OutputInterface $output)
        {
            $io = new SymfonyStyle($input, $output);
            $io->title('Executing grumphp please wait !');
            $x = new Shell(base('vendor', 'bin', 'grumphp') . ' run');
            if ($x->run()) {
                $io->success('Congratulations no errors has been found');
                return 0;
            }
            $io->error($x->get()->getOutput());
            return 1;
        }
    }
}