Exemplo n.º 1
0
            shouldThrowException(function () {
                Expectation::addMatcher('toTest', 'pho\\spec\\Expectation\\Matcher\\MockMatcher');
                $expect = new Expectation('a');
                $expect->toTest('b');
            });
            $expect = new Expectation('a');
            $expect->toTest('a');
        });
        it('can be called in their negated form', function () {
            shouldThrowException(function () {
                Expectation::addMatcher('toTest', 'pho\\spec\\Expectation\\Matcher\\MockMatcher');
                $expect = new Expectation('a');
                $expect->notToTest('a');
            });
            $expect = new Expectation('a');
            $expect->notToTest('b');
        });
    });
    it('throws a BadMethodCallException with an invalid method', function () {
        shouldThrowException(function () {
            $expect = new Expectation('test');
            $expect->invalidMethod();
        }, '\\BadMethodCallException');
    });
    it('throws a BadMethodCallException with an invalid negated method', function () {
        shouldThrowException(function () {
            $expect = new Expectation('test');
            $expect->notInvalidMethod();
        }, '\\BadMethodCallException');
    });
});