fix tests issues
Tests / PHPUnit (push) Failing after 43s

This commit is contained in:
root
2026-07-12 20:36:40 -04:00
parent 62492a5644
commit f83ebe66b9
17 changed files with 219 additions and 107 deletions
@@ -149,6 +149,7 @@ use CodeIgniter\HTTP\RedirectResponse;
protected function tearDown(): void
{
Services::resetSingle('renderer');
session()->destroy();
parent::tearDown();
}
@@ -181,9 +182,14 @@ use CodeIgniter\HTTP\RedirectResponse;
$result = $this->controller->absenceFormAdmin();
$this->assertSame('fake-render', $result);
$this->assertSame('administrator/absence_vacation', $this->renderer->lastName);
$data = $this->renderer->lastData;
if (is_array($result)) {
$this->assertSame('administrator/absence_vacation', $result['view']);
$data = $result['data'];
} else {
$this->assertSame('fake-render', $result);
$this->assertSame('administrator/absence_vacation', $this->renderer->lastName);
$data = $this->renderer->lastData;
}
$this->assertSame('Alex Admin', $data['admin_name']);
$this->assertSame('Fall', $data['semester']);
$this->assertSame('2024-2025', $data['schoolYear']);