lithium\tests\cases\util\ValidatorTest::testCheckMultipleHasFirstError PHP Метод

testCheckMultipleHasFirstError() публичный Метод

    public function testCheckMultipleHasFirstError()
    {
        $rules = array('title' => 'please enter a title', 'email' => array(array('notEmpty', 'message' => 'email is empty'), array('email', 'message' => 'email is not valid')));
        $data = array('email' => 'something');
        $result = Validator::check($data, $rules);
        // result:
        $errors = array('title' => array('please enter a title'), 'email' => array('email is not valid'));
        $this->assertNotEmpty($result);
        $this->assertEqual($errors, $result);
    }