Skip to content

Commit

Permalink
Added a test method
Browse files Browse the repository at this point in the history
  • Loading branch information
lilHermit committed Mar 6, 2017
1 parent 0b533e4 commit a04924e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TestCase/Validation/ValidatorTest.php
Expand Up @@ -1879,4 +1879,19 @@ protected function assertProxyMethod($validator, $method, $extra = null, $pass =
$this->assertEquals('the message', $rule->get('message'), 'Error messages are not the same');
$this->assertEquals('create', $rule->get('on'), 'On clause is wrong');
}

/**
* Testing adding DefaultProvider
*
* @return void
*/
public function testAddingDefaultProvider()
{
$validator = new Validator;
$this->assertEmpty($validator->providers(), 'Providers should be empty');

Validator::addDefaultProvider('test-provider', '\MyNameSpace\Validation\MyProvider');
$validator = new Validator;
$this->assertEquals($validator->providers(), ['test-provider'], 'Default provider `test-provider` is missing');
}
}

0 comments on commit a04924e

Please sign in to comment.