Phalcon\Test\Unit\Validation\Validator\UniquenessTest::testMultipleFields PHP Method

testMultipleFields() public method

Tests uniqueness validator with multiple fields
Since: 2016-06-05
Author: Wojciech Ĺšlawski ([email protected])
public testMultipleFields ( )
    public function testMultipleFields()
    {
        $this->specify('Test uniqueness with combination of fields.', function () {
            $validation = new Validation();
            $validation->add(['name', 'type'], new Uniqueness());
            $messages = $validation->validate(null, $this->robot);
            expect($messages->count())->equals(1);
            $messages = $validation->validate(null, $this->anotherRobot);
            expect($messages->count())->equals(0);
        });
    }