@@ -38,48 +38,48 @@ |
||
38 | 38 | parent::__construct(); |
39 | 39 | } |
40 | 40 | |
41 | - /** |
|
42 | - * Execute the console command. |
|
43 | - * |
|
44 | - * @throws \Exception |
|
45 | - */ |
|
41 | + /** |
|
42 | + * Execute the console command. |
|
43 | + * |
|
44 | + * @throws \Exception |
|
45 | + */ |
|
46 | 46 | public function handle() |
47 | 47 | { |
48 | - $phpunit = exec('which phpunit'); |
|
49 | - if (empty($phpunit)) { |
|
50 | - $this->error('phpunit not found on your system'); |
|
51 | - return; |
|
52 | - } |
|
48 | + $phpunit = exec('which phpunit'); |
|
49 | + if (empty($phpunit)) { |
|
50 | + $this->error('phpunit not found on your system'); |
|
51 | + return; |
|
52 | + } |
|
53 | 53 | |
54 | - $php = exec('which php'); |
|
54 | + $php = exec('which php'); |
|
55 | 55 | |
56 | - $phpunitxml = base_path('phpunit.xml'); |
|
56 | + $phpunitxml = base_path('phpunit.xml'); |
|
57 | 57 | $testPath = GenerateConfigReader::read('test')->getPath(); |
58 | 58 | |
59 | - /** @var \Nwidart\Modules\Module[] $modules */ |
|
60 | - $modules = $this->argument($this->argumentModule) ? [$this->laravel['modules']->findOrFail($this->getModuleName())] : $this->laravel['modules']->getByStatus(1); |
|
59 | + /** @var \Nwidart\Modules\Module[] $modules */ |
|
60 | + $modules = $this->argument($this->argumentModule) ? [$this->laravel['modules']->findOrFail($this->getModuleName())] : $this->laravel['modules']->getByStatus(1); |
|
61 | 61 | |
62 | - $descriptorspec = [ |
|
63 | - ['pipe', 'r'], |
|
64 | - ]; |
|
62 | + $descriptorspec = [ |
|
63 | + ['pipe', 'r'], |
|
64 | + ]; |
|
65 | 65 | |
66 | - $process = null; |
|
66 | + $process = null; |
|
67 | 67 | |
68 | 68 | foreach ($modules as $module) { |
69 | - $directory = $module->getPath().DIRECTORY_SEPARATOR.$testPath; |
|
70 | - if (! file_exists($directory)) { |
|
71 | - continue; |
|
72 | - } |
|
69 | + $directory = $module->getPath().DIRECTORY_SEPARATOR.$testPath; |
|
70 | + if (! file_exists($directory)) { |
|
71 | + continue; |
|
72 | + } |
|
73 | 73 | |
74 | - if (! File::glob($directory.DIRECTORY_SEPARATOR.'*.php')) { |
|
75 | - continue; |
|
76 | - } |
|
74 | + if (! File::glob($directory.DIRECTORY_SEPARATOR.'*.php')) { |
|
75 | + continue; |
|
76 | + } |
|
77 | 77 | |
78 | - $this->info("Running tests for module {$module}:"); |
|
79 | - $process = proc_open("{$php} {$phpunit} -c {$phpunitxml} {$directory}", $descriptorspec, $pipes); |
|
78 | + $this->info("Running tests for module {$module}:"); |
|
79 | + $process = proc_open("{$php} {$phpunit} -c {$phpunitxml} {$directory}", $descriptorspec, $pipes); |
|
80 | 80 | } |
81 | 81 | if (is_resource($process)) { |
82 | - proc_close($process); |
|
82 | + proc_close($process); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 |
@@ -67,11 +67,11 @@ |
||
67 | 67 | |
68 | 68 | foreach ($modules as $module) { |
69 | 69 | $directory = $module->getPath().DIRECTORY_SEPARATOR.$testPath; |
70 | - if (! file_exists($directory)) { |
|
70 | + if (!file_exists($directory)) { |
|
71 | 71 | continue; |
72 | 72 | } |
73 | 73 | |
74 | - if (! File::glob($directory.DIRECTORY_SEPARATOR.'*.php')) { |
|
74 | + if (!File::glob($directory.DIRECTORY_SEPARATOR.'*.php')) { |
|
75 | 75 | continue; |
76 | 76 | } |
77 | 77 |