1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| <?php
declare(strict_types=1);
namespace Tests;
use PHPUnit\Runner\AfterTestHook;
class LongRunningTestsLogger implements AfterTestHook
{
public function __construct(private string $log_file) {
}
public function executeAfterTest(string $test, float $time): void
{
$fp = fopen($this->log_file . '.csv', 'a');
fputcsv($fp, [$test, $time]);
fclose($fp);
}
}
|