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

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

    public function testValidationWithContextData()
    {
        Validator::add('someModelRule', function ($value, $format, $options) {
            return $value === 'Title' && $options['values']['body'] === 'Body';
        });
        $result = Validator::check(array('title' => 'Title', 'body' => 'Body'), array('title' => array('someModelRule')));
        $this->assertIdentical(array(), $result);
        $result = Validator::check(array('title' => 'Title', 'body' => 'Not Body'), array('title' => array('someModelRule')));
        $this->assertIdentical(array('title' => array(0)), $result);
    }