Skip to content

Commit a148a1e

Browse files
Fix tests on windows.
Minor: fopen('/dev/null', 'r') is not cross-platform. As much as this will run in a *nix environment. I like to run test-suites on ANY reasonable machine.
1 parent 9dbe92e commit a148a1e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/curl_and_error_log_function_stubs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function curl_init($url = null)
2424

2525
$curlSpy->curlInitWasCalledWithArg($url);
2626

27-
$resource = fopen('/dev/null', 'r');
27+
$resource = tmpfile();
2828

2929
$curlSpy->curlInitDidReturn($resource);
3030

tests/socket_function_stubs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function socket_create($domain, $type, $protocol)
2929

3030
// A PHP resource of unimportance, useful primarily to assert that our stubs
3131
// of the global socket functions return or take a deterministic value.
32-
$resource = fopen('/dev/null', 'r');
32+
$resource = tmpfile();
3333

3434
$socketSpy->socketCreateDidReturn($resource);
3535

0 commit comments

Comments
 (0)