| Total Complexity | 7 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 29 | ||
| Bugs | 5 | Features | 7 |
| 1 | <?php |
||
| 16 | final class Tester { |
||
| 17 | use \Nette\SmartObject; |
||
| 18 | |||
| 19 | private const PACKAGE_NAME = "konecnyjakub/mytester"; |
||
| 20 | |||
| 21 | /** @var string[] */ |
||
| 22 | private array $suits; |
||
| 23 | /** @var callable[] */ |
||
| 24 | public array $onExecute = [ |
||
| 25 | Environment::class . "::setup", |
||
| 26 | ]; |
||
| 27 | public ITestSuitFactory $testSuitFactory; |
||
| 28 | private string $folder; |
||
| 29 | |||
| 30 | public function __construct(string $folder) { |
||
| 31 | $this->onExecute[] = [$this, "printInfo"]; |
||
| 32 | $this->suits = (new TestSuitsFinder())->getSuits($folder); |
||
| 33 | $this->testSuitFactory = new class implements ITestSuitFactory { |
||
| 34 | public function create(string $className): TestCase { |
||
| 35 | return new $className(); |
||
| 36 | } |
||
| 37 | }; |
||
| 38 | $this->folder = $folder; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return string[] |
||
| 43 | */ |
||
| 44 | protected function getSuits(): array { |
||
| 45 | return $this->suits; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Execute all tests |
||
| 50 | */ |
||
| 51 | public function execute(): void { |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Print version of My Tester and PHP |
||
| 66 | */ |
||
| 67 | private function printInfo(): void { |
||
| 72 | } |
||
| 73 | } |
||
| 74 | ?> |