function it_creates_form(EventDispatcher $eventDispatcher, Form $form) { $eventDispatcher->dispatch(CreateFormEvent::NAME, Argument::type('Netzmacht\\Workflow\\Factory\\Event\\CreateFormEvent'))->will(function ($arguments) use($form) { /** @var CreateFormEvent $event */ $event = $arguments[1]; $event->setForm($form->getWrappedObject()); }); $this->createForm('form_type', 'form_name')->shouldReturn($form); }
/** * Build transition form. * * @param Form $form The form being built. * * @return void */ private function buildForm(Form $form) { $this->form = $form; $this->getTransition()->buildForm($this->form, $this->item); $form->prepare($this->item, $this->context); $this->listener->onBuildForm($form, $this->workflow, $this->item, $this->context, $this->getTransition()->getName()); }
/** * {@inheritdoc} */ public function buildForm(Form $form, Item $item) { if ($this->formType && $form instanceof ContaoForm) { $form->addForm($this->formType); } }