| 1 | <?php |
||
| 8 | abstract class Channel implements AfterTestHook, AfterLastTestHook |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Tests marked as slow. |
||
| 12 | * |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $tests = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The max number of rows to be reported. |
||
| 19 | * |
||
| 20 | * @var int|null |
||
| 21 | */ |
||
| 22 | protected $rows; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The minimum amount of miliseconds to consider a test slow. |
||
| 26 | * |
||
| 27 | * @var int|null |
||
| 28 | */ |
||
| 29 | protected $min; |
||
| 30 | |||
| 31 | public function __construct(?int $rows = null, ?int $min = 200) |
||
| 36 | |||
| 37 | public function executeAfterTest(string $test, float $time): void |
||
| 47 | |||
| 48 | protected function timeToMiliseconds(float $time): int |
||
| 52 | |||
| 53 | public function executeAfterLastTest(): void |
||
| 59 | |||
| 60 | protected function sortTestsBySpeed(): void |
||
| 64 | |||
| 65 | abstract protected function printResults(): void; |
||
| 66 | |||
| 67 | protected function testsToPrint(): array |
||
| 75 | |||
| 76 | protected function getClassName(): string |
||
| 80 | } |