Exemplo n.º 1
0
         expect(Checker::is('uuid', '1-1c0a5832-6025-11de-8a39-0800200c9a66'))->toBe(false);
     });
     it("checks the not option", function () {
         expect(Checker::is('inList', 'one', ['list' => ['one', 'two']]))->toBe(true);
         expect(Checker::is('not:inList', 'one', ['list' => ['one', 'two']]))->toBe(false);
         expect(Checker::isNotInList('one', ['list' => ['one', 'two']]))->toBe(false);
     });
 });
 describe("::__callStatic()", function () {
     it("delegates to the checker", function () {
         $handler = Checker::get('alphaNumeric');
         expect(Checker::class)->toReceive('::check')->with('frferrf', [$handler], ['hello' => 'world']);
         Checker::isAlphaNumeric('frferrf', ['hello' => 'world']);
     });
     it("bails out with no passed parameters", function () {
         expect(Checker::isAlphaNumeric())->toBe(false);
     });
 });
 describe("::message()", function () {
     it("gets a error message", function () {
         expect(Checker::message('required'))->toBe('is required');
     });
     it("sets an error message", function () {
         expect(Checker::message('required', 'must be defined'))->toBe('must be defined');
         expect(Checker::message('required'))->toBe('must be defined');
     });
 });
 describe("::messages()", function () {
     beforeEach(function () {
         Checker::messages(['a' => 'b'], false);
     });