}); }); }); context('toBeAnInstanceOf', function () { it('returns if the object has the expected class', function () { shouldReturn(function () { $expect = new Expectation(new \stdClass()); $expect->toBeAnInstanceOf('stdClass'); }); }); it('throws exception if not of the expected class', function () { shouldThrowException(function () { $closure = function () { }; $expect = new Expectation($closure); $expect->toBeAnInstanceOf('stdClass'); }); }); }); context('notToBeAnInstanceOf', function () { it('returns if the object if not of the expected class', function () { shouldReturn(function () { $expect = new Expectation(new \stdClass()); $expect->notToBeAnInstanceOf('Closure'); }); }); it('throws exception if it has the expected class', function () { shouldThrowException(function () { $expect = new Expectation(new \stdClass()); $expect->notToBeAnInstanceOf('stdClass'); });