$expect = new Expectation('test'); $expect->toBeAn('integer'); }); }); }); context('notToBeAn', function () { it('returns if the value is not the given type', function () { shouldReturn(function () { $expect = new Expectation('test'); $expect->notToBeAn('integer'); }); }); it('throws exception if it is of the given type', function () { shouldThrowException(function () { $expect = new Expectation(123); $expect->notToBeAn('integer'); }); }); }); 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);