public function testCustomRule() { $foo = function () { }; $bar = function () { }; Validator::addRule('foo', $foo); Validator::addRules(['bar' => $bar]); $this->assertInstanceOf('Sloths\\Validation\\Validator\\Callback', Validator::createRule('foo')); $this->assertInstanceOf('Sloths\\Validation\\Validator\\Callback', Validator::createRule('bar')); }