$expect = new Expectation('123'); $expect->notToMatch('/\\d*/'); }); }); }); context('toStartWith', function () { it('returns if the string contains the prefix', function () { shouldReturn(function () { $expect = new Expectation('test123'); $expect->toStartWith('test'); }); }); it('throws exception if it does not contain the prefix', function () { shouldThrowException(function () { $expect = new Expectation('test123'); $expect->toStartWith('123'); }); }); }); context('notToStartWith', function () { it('returns if the string does not contain the prefix', function () { shouldReturn(function () { $expect = new Expectation('test123'); $expect->notToStartWith('123'); }); }); it('throws exception if it contains the prefix', function () { shouldThrowException(function () { $expect = new Expectation('test123'); $expect->notToStartWith('test'); });