Author: Bernhard Schussek (bschussek@gmail.com)
Inheritance: extends Symfony\Component\Validator\ConstraintValidator
 /**
  * @param string $url
  * @return \FormValidator
  */
 private function getSearchForm($url)
 {
     $form = new \FormValidator('search-form', 'get', $url, null, array('class' => 'form-inline'));
     $form->addElement('text', 'keyword');
     $form->addElement('button', 'submit', get_lang('Search'));
     return $form;
 }
 public function testNoViolationIfNotRoot()
 {
     $this->serverParams->expects($this->once())->method('getContentLength')->will($this->returnValue(1025));
     $this->serverParams->expects($this->never())->method('getNormalizedIniPostMaxSize');
     $context = $this->getExecutionContext();
     $parent = $this->getBuilder()->setCompound(true)->setDataMapper($this->getDataMapper())->getForm();
     $form = $this->getForm();
     $parent->add($form);
     $this->validator->initialize($context);
     $this->validator->validate($form, new Form());
     $this->assertCount(0, $context->getViolations());
 }