Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions tests/system/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,17 @@ public function testConstructorHTTPS(): void
$_SERVER = $original; // restore so code coverage doesn't break
}

public function testCachePage(): void
public function testCachePageSetsTtl(): void
{
$this->controller = new Controller();
$this->controller->initController($this->request, $this->response, $this->logger);

$method = self::getPrivateMethodInvoker($this->controller, 'cachePage');
$this->assertNull($method(10));

$this->assertSame(0, self::getPrivateProperty(service('responsecache'), 'ttl'));

$method(10);
$this->assertSame(10, self::getPrivateProperty(service('responsecache'), 'ttl'));
}

public function testValidate(): void
Expand Down
5 changes: 3 additions & 2 deletions tests/system/Database/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace CodeIgniter\Database;

use CodeIgniter\Database\Postgre\Connection as PostgreConnection;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\ReflectionHelper;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down Expand Up @@ -149,7 +150,7 @@ public function testConnectionGroupWithDSN(): void
public function testConnectionGroupWithDSNPostgre(): void
{
$conn = Config::connect($this->dsnGroupPostgre, false);
$this->assertInstanceOf(BaseConnection::class, $conn);
$this->assertInstanceOf(PostgreConnection::class, $conn);

$this->assertSame('', $this->getPrivateProperty($conn, 'DSN'));
$this->assertSame('localhost', $this->getPrivateProperty($conn, 'hostname'));
Expand Down Expand Up @@ -205,7 +206,7 @@ public function testConvertDSN(string $input, string $expected): void
// Should deprecate?
$this->dsnGroupPostgreNative['DSN'] = $input;
$conn = Config::connect($this->dsnGroupPostgreNative, false);
$this->assertInstanceOf(BaseConnection::class, $conn);
$this->assertInstanceOf(PostgreConnection::class, $conn);

$method = self::getPrivateMethodInvoker($conn, 'convertDSN');
$method();
Expand Down
Loading