File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use ArgumentCountError ;
15
15
use CodeIgniter \Test \CIUnitTestCase ;
16
+ use ErrorException ;
16
17
use RuntimeException ;
17
18
18
19
/**
@@ -151,7 +152,7 @@ public function testRecordArrowFunction()
151
152
$ timer = new Timer ();
152
153
$ returnValue = $ timer ->record ('longjohn ' , static fn () => strlen ('CI4 ' ));
153
154
154
- $ this ->assertLessThanOrEqual ( 1.0 , $ timer ->getElapsedTime ('longjohn ' ));
155
+ $ this ->assertLessThan ( 0.1 , $ timer ->getElapsedTime ('longjohn ' ));
155
156
$ this ->assertSame (3 , $ returnValue );
156
157
}
157
158
@@ -165,7 +166,11 @@ public function testRecordThrowsException()
165
166
166
167
public function testRecordThrowsErrorOnCallableWithParams ()
167
168
{
168
- $ this ->expectException (ArgumentCountError::class);
169
+ if (version_compare (PHP_VERSION , '8.0.0 ' ) >= 0 ) {
170
+ $ this ->expectException (ArgumentCountError::class);
171
+ } else {
172
+ $ this ->expectException (ErrorException::class);
173
+ }
169
174
170
175
$ timer = new Timer ();
171
176
$ timer ->record ('error ' , 'strlen ' );
You can’t perform that action at this time.
0 commit comments