spec\Sylius\Bundle\ResourceBundle\Form\EventSubscriber\AddCodeFormSubscriberSpec::it_sets_code_as_disabled_when_resource_is_not_new PHP Метод

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

public it_sets_code_as_disabled_when_resource_is_not_new ( Symfony\Component\Form\FormEvent $event, Symfony\Component\Form\FormInterface $form, Sylius\Component\Resource\Model\CodeAwareInterface $resource )
$event Symfony\Component\Form\FormEvent
$form Symfony\Component\Form\FormInterface
$resource Sylius\Component\Resource\Model\CodeAwareInterface
    function it_sets_code_as_disabled_when_resource_is_not_new(FormEvent $event, FormInterface $form, CodeAwareInterface $resource)
    {
        $event->getData()->willReturn($resource);
        $event->getForm()->willReturn($form);
        $resource->getCode()->willReturn('Code12');
        $form->add('code', Argument::type('string'), Argument::withEntry('disabled', true))->shouldBeCalled();
        $this->preSetData($event);
    }