/**
  * Check native constraints functionality independently of type of fields
  * /fp_js_form_validator/javascript_unit_test/basic_constraints/{isValid}/{js}
  *
  * @param \Symfony\Component\HttpFoundation\Request $request
  * @param string                                    $isValid
  * @param string                                    $js
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function basic_constraintsAction(Request $request, $isValid, $js)
 {
     $data = array(array('blank' => null, 'notBlank' => 'a', 'email' => '*****@*****.**', 'url' => 'https://www.google.com', 'regex' => 'aaa123', 'ip' => '125.125.125.0', 'time' => '12:15:32', 'date' => '2013-04-04', 'datetime' => '2013-04-04 12:15:32'), array('blank' => 'a', 'notBlank' => null, 'email' => 'wrong_email', 'url' => 'wrong_url', 'regex' => 'bbb', 'ip' => '125.125.125', 'time' => '12/15/32', 'date' => '04/04/2013', 'datetime' => '04/04/2013_12:15:32'));
     $data = $isValid ? $data[0] : $data[1];
     $entity = new BasicConstraintsEntity();
     $entity->populate($data);
     $entity->isValid = (bool) $isValid;
     $form = $this->createForm(new BasicConstraintsEntityType(), $entity, array('js_validation' => (bool) $js));
     $form->handleRequest($request);
     return $this->render('DefaultTestBundle:FunctionalTests:index.html.twig', array('form' => $form->createView(), 'isValid' => $isValid));
 }
 /**
  * @param BasicConstraintsEntity    $object
  * @param ExecutionContextInterface $context
  */
 public static function validateDirectStaticCallback($object, ExecutionContextInterface $context)
 {
     if (!$object->isValid) {
         $context->addViolationAt('email', 'direct_static_callback_email_' . $object->getEmail(), array(), null);
     }
 }