Esempio n. 1
0
 });
 describe("->meta()", function () {
     it("gets/sets meta data", function () {
         $validator = new Validator();
         $meta = ['model' => 'Post'];
         expect($validator->meta($meta))->toBe($meta);
         expect($validator->meta())->toBe($meta);
     });
 });
 describe("->error()", function () {
     it("gets/sets the error handler", function () {
         $validator = new Validator();
         $handler = function () {
             return 'hello world';
         };
         expect($validator->error($handler))->toBe($handler);
         expect($validator->error())->toBe($handler);
     });
 });
 describe("->get()", function () {
     it("throws an exceptions for unexisting validation handler", function () {
         $closure = function () {
             $validator = new Validator();
             $validator->get('abc');
         };
         expect($closure)->toThrow(new InvalidArgumentException("Unexisting `abc` as validation handler."));
     });
 });
 describe("->set()", function () {
     it("sets some local handlers", function () {
         $validator = new Validator();