コード例 #1
0
ファイル: ExpectationSpec.php プロジェクト: ciarand/pho
     it('throws exception if none of the values are included', function () {
         shouldThrowException(function () {
             $expect = new Expectation(array('test', 'spec'));
             $expect->toContainAnyOf('tdd', 'bdd');
         });
     });
     it('returns if the string contains one of the substrings', function () {
         shouldReturn(function () {
             $expect = new Expectation('testing');
             $expect->toContainAnyOf('spec', 'test');
         });
     });
     it('throws exception if none of the substrings are found', function () {
         shouldThrowException(function () {
             $expect = new Expectation('testing');
             $expect->toContainAnyOf('TEST', 'ING');
         });
     });
 });
 context('notToContainAnyOf', function () {
     it('returns if the array does not contain any of the values', function () {
         shouldReturn(function () {
             $expect = new Expectation(array('test', 'spec'));
             $expect->notToContainAnyOf('bdd', 'tdd');
         });
     });
     it('throws exception if any of the values are included', function () {
         shouldThrowException(function () {
             $expect = new Expectation(array('test', 'spec'));
             $expect->notToContainAnyOf('tdd', 'test');
         });