mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: number_format(): Passing null to parameter #1 ($num) of type float is deprecated
Fixes #5535
This commit is contained in:
parent
6b2816c7fe
commit
e51a1d9af0
@ -258,14 +258,14 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $connectTime;
|
||||
protected $connectTime = 0.0;
|
||||
|
||||
/**
|
||||
* How long it took to establish connection.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
protected $connectDuration;
|
||||
protected $connectDuration = 0.0;
|
||||
|
||||
/**
|
||||
* If true, no queries will actually be
|
||||
|
@ -123,6 +123,16 @@ final class BaseConnectionTest extends CIUnitTestCase
|
||||
$this->assertGreaterThan(0.0, $db->getConnectDuration());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/codeigniter4/CodeIgniter4/issues/5535
|
||||
*/
|
||||
public function testStoresConnectionTimingsNotConnected()
|
||||
{
|
||||
$db = new MockConnection($this->options);
|
||||
|
||||
$this->assertSame('0.000000', $db->getConnectDuration());
|
||||
}
|
||||
|
||||
public function testMagicIssetTrue()
|
||||
{
|
||||
$db = new MockConnection($this->options);
|
||||
|
Loading…
x
Reference in New Issue
Block a user