Example #1
0
             $expect = new Expectation(1);
             $expect->toBeA('string');
         });
     });
 });
 context('notToBeA', function () {
     it('returns if the value is not the given type', function () {
         shouldReturn(function () {
             $expect = new Expectation(1);
             $expect->notToBeA('string');
         });
     });
     it('throws exception if it is of the given type', function () {
         shouldThrowException(function () {
             $expect = new Expectation('test');
             $expect->notToBeA('string');
         });
     });
 });
 context('toBeAn', function () {
     it('returns if the value has the expected type', function () {
         shouldReturn(function () {
             $expect = new Expectation(123);
             $expect->toBeAn('integer');
         });
     });
     it('throws exception if not of the expected type', function () {
         shouldThrowException(function () {
             $expect = new Expectation('test');
             $expect->toBeAn('integer');
         });