diff --git a/src/Database.php b/src/Database.php index cff5961..b18b4d6 100644 --- a/src/Database.php +++ b/src/Database.php @@ -792,7 +792,7 @@ protected function finalizeAddToDebug( ) : void { $end = \microtime(true); $rows = $this->mysqli->affected_rows; - $rows = $rows < 0 ? $rows . ' (failed)' : $rows; + $rows = $rows < 0 ? 'error' : $rows; $this->debugCollector->addData([ 'start' => $start, 'end' => $end, diff --git a/tests/Debug/DatabaseCollectorTest.php b/tests/Debug/DatabaseCollectorTest.php index d9cb8ea..d618778 100644 --- a/tests/Debug/DatabaseCollectorTest.php +++ b/tests/Debug/DatabaseCollectorTest.php @@ -130,6 +130,12 @@ public function testFinalizeAddToDebug() : void $data = $this->collector->getData(); $data = $data[\array_key_last($data)]; self::assertSame('Foo Bar', $data['statement']); - self::assertSame('-1 (failed)', $data['rows']); + self::assertSame('error', $data['rows']); + $contents = $this->collector->getContents(); + self::assertStringContainsString('error', $contents); + self::assertStringContainsString( + \htmlentities($data['description']), + $contents + ); } }