Skip to content

Commit 7e088c1

Browse files
Add option to disable expect so PHPSpec Expect can play along nice with Kahlan's expect
1 parent f3a80b7 commit 7e088c1

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
@@ -29,7 +29,13 @@
2929
use PhpSpec\Wrapper\Unwrapper;
3030
use Symfony\Component\EventDispatcher\EventDispatcher;
3131

32-
if (!function_exists('expect')) {
32+
$useExpect = true;
33+
34+
if (getenv('PHPSPEC_DISABLE_EXPECT') || (defined('PHPSPEC_DISABLE_EXPECT') && PHPSPEC_DISABLE_EXPECT)) {
35+
$useExpect = false;
36+
}
37+
38+
if ($useExpect && !function_exists('expect')) {
3339
function expect($sus)
3440
{
3541
$presenter = new TaggedPresenter(new Differ);

0 commit comments

Comments
 (0)