| 1 | <?php |
||
| 10 | class Watcher |
||
| 11 | { |
||
| 12 | /** @var \Symfony\Component\Finder\Finder */ |
||
| 13 | protected $finder; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | protected $pathToCacheFile; |
||
| 17 | |||
| 18 | /** @var $string */ |
||
| 19 | protected $phpunitArguments; |
||
| 20 | |||
| 21 | public function __construct(Finder $finder) |
||
| 27 | |||
| 28 | public function useCacheFile(string $pathToCacheFile) |
||
| 32 | |||
| 33 | public function usePhpunitArguments(string $arguments) |
||
| 39 | |||
| 40 | public function startWatching() |
||
| 62 | |||
| 63 | protected function runTests() |
||
| 64 | { |
||
| 65 | (new Process("vendor/bin/phpunit {$this->phpunitArguments}")) |
||
| 66 | ->setTty(true) |
||
| 67 | ->run(function ($type, $line) { |
||
| 68 | echo $line; |
||
| 69 | }); |
||
| 70 | } |
||
| 71 | |||
| 72 | protected function clearScreen() |
||
| 76 | } |
||
| 77 |