Skip to content

Commit eb74c74

Browse files
Merge pull request #27 from blazej-pachut-gforces/master
Enable disabling expect() function by environment variable
2 parents 70442be + 7e088c1 commit eb74c74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

expect.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@
3434
use PhpSpec\Wrapper\Unwrapper;
3535
use Symfony\Component\EventDispatcher\EventDispatcher;
3636

37-
if (!function_exists('expect')) {
37+
$useExpect = true;
38+
39+
if (getenv('PHPSPEC_DISABLE_EXPECT') || (defined('PHPSPEC_DISABLE_EXPECT') && PHPSPEC_DISABLE_EXPECT)) {
40+
$useExpect = false;
41+
}
42+
43+
if ($useExpect && !function_exists('expect')) {
3844
function expect($sus)
3945
{
4046
$container = new IndexedServiceContainer;

0 commit comments

Comments
 (0)