Skip to content

Predicate matching replaces the actual value with a boolean #96

Closed
MarcelloDuarte opened this Issue Sep 2, 2012 · 0 comments

1 participant

@MarcelloDuarte
PHPSpec Framework member

If you perform a series of predicate matching and other matching the second time around PHPSpec complains because the intercepted object has become a boolen:

function itJacksHumansIn() {
    $this->human = new Human('Leo');
    $matrix = $this->spec(new Matrix);
    $matrix->jackInHuman($this->human);
    $matrix->should->haveHuman($this->human);
    $human = new Human('Eduard');
    $matrix->jackInHuman($human);
    $matrix->should->haveHuman($this->human);
    $matrix->should->haveHuman($human);
}

Will result in:

E

Errors:

1) Matrix jacks humans in
PHPSpec\Specification\Result\Error: $matrix->jackInHuman($human);
PHP Warning: get_class() expects parameter 1 to be object, boolean given

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.