Пример #1
0
 /**
  * @dataProvider getValidTestData
  */
 public function testForm($data)
 {
     $type = new CreateDepartmentType();
     $form = $this->factory->create($type);
     $object = new Department();
     $object->fromArray($data);
     // submit the data to the form directly
     $form->submit($data);
     $this->assertTrue($form->isSynchronized());
     $this->assertEquals($object, $form->getData());
     $view = $form->createView();
     $children = $view->children;
     foreach (array_keys($data) as $key) {
         $this->assertArrayHasKey($key, $children);
     }
 }