function it_should_create_resource_with_form_options()
 {
     $text = new TextType('resources.resource_text');
     $text->setFormOptions(array('attr' => array('class' => 'class-name')));
     $this->beConstructedWith(__DIR__ . '/../../../../Fixtures/simple_valid_map_with_form_options.yml', $this->resources);
     $this->getResource('resources.resource_text')->shouldBeLike($text);
 }
 /**
  * @param \FSi\Bundle\ResourceRepositoryBundle\Repository\MapBuilder $mapBuilder
  * @param \Symfony\Component\Form\FormFactoryInterface $formFactory
  * @param \FSi\Bundle\AdminBundle\Admin\ResourceRepository\GenericResourceElement $element
  * @param \FSi\Bundle\ResourceRepositoryBundle\Model\ResourceValueRepository $valueRepository
  * @param \FSi\Bundle\ResourceRepositoryBundle\Repository\Resource\Type\TextType $resource
  */
 function let($mapBuilder, $formFactory, $element, $valueRepository, $resource)
 {
     $mapBuilder->getMap()->willReturn(array('resources' => array('resource_key' => $resource)));
     $resource->getName()->willReturn('resources.resource_key');
     $element->getRepository()->willReturn($valueRepository);
     $element->getResourceFormOptions()->willReturn(array('form_options'));
     $this->beConstructedWith($formFactory, $mapBuilder);
 }
 function it_removes_entity_when_setting_empty_value(MapBuilder $builder, ResourceRepository $repository, TextType $resource, ResourceEntity $entity)
 {
     $resource->getName()->willReturn('resources_group.resource_a.en');
     $repository->get('resources_group.resource_a.en')->willReturn($entity);
     $builder->getResource(Argument::type('string'))->willReturn($resource);
     $resource->getResourceProperty()->willReturn('textValue');
     $repository->remove($entity)->shouldBeCalled();
     $this->set('resources_group.resource_a', null);
 }