File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -258,14 +258,14 @@ abstract class BaseConnection implements ConnectionInterface
258
258
*
259
259
* @var float
260
260
*/
261
- protected $ connectTime ;
261
+ protected $ connectTime = 0.0 ;
262
262
263
263
/**
264
264
* How long it took to establish connection.
265
265
*
266
266
* @var float
267
267
*/
268
- protected $ connectDuration ;
268
+ protected $ connectDuration = 0.0 ;
269
269
270
270
/**
271
271
* If true, no queries will actually be
Original file line number Diff line number Diff line change @@ -123,6 +123,16 @@ public function testStoresConnectionTimings()
123
123
$ this ->assertGreaterThan (0.0 , $ db ->getConnectDuration ());
124
124
}
125
125
126
+ /**
127
+ * @see https://github.com/codeigniter4/CodeIgniter4/issues/5535
128
+ */
129
+ public function testStoresConnectionTimingsNotConnected ()
130
+ {
131
+ $ db = new MockConnection ($ this ->options );
132
+
133
+ $ this ->assertSame ('0.000000 ' , $ db ->getConnectDuration ());
134
+ }
135
+
126
136
public function testMagicIssetTrue ()
127
137
{
128
138
$ db = new MockConnection ($ this ->options );
You can’t perform that action at this time.
0 commit comments