-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the failing #138 test into 2 cases
- Loading branch information
1 parent
aa07fc1
commit 923f940
Showing
2 changed files
with
35 additions
and
1 deletion.
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
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,32 @@ | ||
--TEST-- | ||
https://github.com/antecedent/patchwork/issues/138 | ||
Case 2/2: the other stream wrapper is registered BEFORE importing Patchwork. | ||
|
||
--FILE-- | ||
<?php | ||
|
||
assert_options(ASSERT_ACTIVE, 1); | ||
assert_options(ASSERT_WARNING, 1); | ||
error_reporting(E_ALL | E_STRICT); | ||
|
||
require __DIR__ . "/includes/StreamWrapperForTesting.php"; | ||
|
||
stream_wrapper_unregister('file'); | ||
stream_wrapper_register('file', 'StreamWrapperForTesting'); | ||
|
||
require __DIR__ . "/../Patchwork.php"; | ||
require __DIR__ . "/includes/Functions.php"; | ||
|
||
Patchwork\redefine('getInteger', function() { | ||
return 1; | ||
}); | ||
|
||
assert(getInteger() === 1); | ||
|
||
assert(in_array('Functions.php', StreamWrapperForTesting::$pathsOpened)); | ||
|
||
?> | ||
===DONE=== | ||
|
||
--EXPECT-- | ||
===DONE=== |