Esempio n. 1
0
 public function testCreateFormWithType()
 {
     /**
      * If we use a type, we have that type's fields.
      * -> The implementation is correct.
      */
     $form = $this->controller->createForm("test_form", "test_type");
     $this->assertTrue($form->getForm()->has("test_field"));
     $this->assertTrue($form->getForm()->has("test_a"));
     $this->assertTrue($form->getForm()->has("test_b"));
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     $this->controller = $this->getController();
     $this->controller->setContainer($this->container);
 }
Esempio n. 3
0
 /**
  * @param $name
  * @param string $type
  * @param array $data
  * @param array $options
  * @return \Thelia\Form\BaseForm
  *
  * Deactivate csrf token by default on API
  */
 public function createForm($name, $type = "form", array $data = array(), array $options = array())
 {
     $options = array_merge(["csrf_protection" => false], $options);
     return parent::createForm($name, $type, $data, $options);
 }