$expect = new Expectation('1'); $expect->toMatch('/\\d{2}/'); }); }); }); context('notToMatch', function () { it('returns if the string does not match the pattern', function () { shouldReturn(function () { $expect = new Expectation('123'); $expect->notToMatch('/test\\d*/'); }); }); it('throws exception if it matches the pattern', function () { shouldThrowException(function () { $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'); });