spec\Sylius\Bundle\CoreBundle\Form\EventSubscriber\AddUserFormSubscriberSpec::it_replaces_user_form_by_new_user_form_when_create_user_check_is_not_checked PHP Метод

it_replaces_user_form_by_new_user_form_when_create_user_check_is_not_checked() публичный Метод

public it_replaces_user_form_by_new_user_form_when_create_user_check_is_not_checked ( Symfony\Component\Form\FormEvent $event, Form $form, Form $createUserCheckForm, Sylius\Component\User\Model\UserAwareInterface $customer )
$event Symfony\Component\Form\FormEvent
$form Symfony\Component\Form\Form
$createUserCheckForm Symfony\Component\Form\Form
$customer Sylius\Component\User\Model\UserAwareInterface
    function it_replaces_user_form_by_new_user_form_when_create_user_check_is_not_checked(FormEvent $event, Form $form, Form $createUserCheckForm, UserAwareInterface $customer)
    {
        $event->getData()->willReturn($customer);
        $event->getForm()->willReturn($form);
        $form->get('createUser')->willReturn($createUserCheckForm);
        $createUserCheckForm->getViewData()->willReturn(null);
        $customer->setUser(null)->shouldBeCalled();
        $event->setData($customer)->shouldBeCalled();
        $form->remove('user')->shouldBeCalled();
        $form->add('user', '\\Fully\\Qualified\\ClassName', Argument::type('array'))->shouldBeCalled();
        $this->submit($event);
    }