assertCount(1, $entries); $this->assertSame('SELECT 1', $entries[0]['sql']); $this->assertSame(1.5, $entries[0]['time_ms']); $this->assertSame('pdo', $entries[0]['driver']); } public function testCountAndTotalTime(): void { Profiler::log('SELECT 1', [], 1.0); Profiler::log('SELECT 2', [], 2.5); $this->assertSame(2, Profiler::count()); $this->assertSame(3.5, Profiler::totalTime()); } public function testResetClearsEntries(): void { Profiler::log('SELECT 1', [], 1.0); Profiler::reset(); $this->assertSame(0, Profiler::count()); $this->assertSame([], Profiler::entries()); } public function testProfilerPdoWrapLogsAndReturnsResult(): void { $result = ProfilerPDO::wrap('SELECT 1', [], static fn () => 'result'); $this->assertSame('result', $result); $this->assertCount(1, Profiler::entries()); $this->assertGreaterThanOrEqual(0, Profiler::entries()[0]['time_ms']); } }