Add PHP unit tests and page tests.

Run "composer install", then "composer test".
This commit is contained in:
tim
2026-09-26 03:48:09 +02:00
parent 848c447c5b
commit ed959888b4
42 changed files with 5522 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Xxx\Tests\Support;
// The result of a FakeDb query
class FakeResult {
private array $rows;
private int $next = 0;
public int $num_rows;
public function __construct(array $rows) {
$this->rows = array_values($rows);
$this->num_rows = count($this->rows);
}
public function fetch_assoc() {
return $this->rows[$this->next++] ?? NULL;
}
public function fetch_row() {
$row = $this->fetch_assoc();
return $row === NULL ? NULL : array_values($row);
}
public function close() {
return TRUE;
}
}