Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/system/Filters/DebugToolbarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\Response;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Test\CIUnitTestCase;
use Config\Filters as FilterConfig;
use PHPUnit\Framework\Attributes\BackupGlobals;
Expand Down Expand Up @@ -60,11 +61,13 @@ public function testDebugToolbarFilter(): void
$expectedAfter = $this->response;

// nothing should change here, since we have no before logic
$filter->before($this->request);
$result = $filter->before($this->request);
$this->assertSame($expectedBefore, $this->request);
$this->assertNull($result);

// nothing should change here, since we are running in the CLI
$filter->after($this->request, $this->response);
$result = $filter->after($this->request, $this->response);
$this->assertSame($expectedAfter, $this->response);
$this->assertNotInstanceOf(ResponseInterface::class, $result);
}
}
Loading