forked from hnw/php-timecop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support strict_types=1 for overridden functions
Fixes hnw#43
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Check for issue #43 (Overridden functions ignore declare(strict_types=1)) | ||
--SKIPIF-- | ||
<?php | ||
$required_version = "7.0"; | ||
$required_func = array("strtotime"); | ||
include(__DIR__."/tests-skipcheck.inc.php"); | ||
--INI-- | ||
date.timezone=GMT | ||
timecop.func_override=1 | ||
--FILE-- | ||
<?php | ||
declare(strict_types=1); | ||
|
||
try { | ||
strtotime(null); | ||
echo "No error thrown!"; | ||
} catch (TypeError $e) { | ||
echo $e->getMessage(); | ||
} | ||
--EXPECT-- | ||
timecop_strtotime() expects parameter 1 to be string, null given |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters