コード例 #1
0
ファイル: ExpectationSpec.php プロジェクト: ciarand/pho
             });
             $expect->notToThrow('\\Exception');
         });
     });
 });
 context('toMatch', function () {
     it('returns if the string matches the pattern', function () {
         shouldReturn(function () {
             $expect = new Expectation('user123');
             $expect->toMatch('/\\w{4}123/');
         });
     });
     it('throws exception if it does not match the pattern', function () {
         shouldThrowException(function () {
             $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*/');
         });