public function testErrorCallbacksCallableDomelement() { $html = '<!DOCTYPE html><html><body><form action="/"><input type="text" name="foo"></form></body></html>'; $parameters = array('foo' => 'bar'); $vm = $this->_context->createInstanceFor('validation_manager'); /** @var $vm \AgaviValidationManager */ $val1 = $vm->createValidator('DummyValidator', array('foo'), array('' => 'My error message')); $val1->val_result = false; $config = array('error_messages' => array('self::*' => array('location' => 'before', 'container' => __CLASS__ . '::_errorCallback'))); $content = $this->executeFormPopulationFilter($html, $parameters, $vm, $config); $xpath = $this->loadXpath($content); $this->assertEquals(1, $xpath->query('//div')->length); }