Phalcon\Test\Unit\Validation\Validator\AlphaTest::testShouldValidateAlphabeticCharacters PHP Method

testShouldValidateAlphabeticCharacters() public method

Tests Alphabetic Characters
Since: 2016-06-10
Author: Serghei Iakovlev ([email protected])
    public function testShouldValidateAlphabeticCharacters()
    {
        $this->specify("The Alpha Validator does not validate alphabetic characters", function ($input) {
            $validation = new Validation();
            $validation->add('name', new Alpha(['message' => ':field must contain only letters']));
            $messages = $validation->validate(['name' => $input]);
            expect($messages)->count(0);
        }, ['examples' => [['a'], ['asdavafaiwnoabwiubafpowf'], ['QWERTYUIOPASDFGHJKL'], ['aSdFgHjKl'], [null]]]);
    }