Пример #1
0
 /**
  * @dataProvider getTypes
  *
  * @param string $type
  */
 public function testTypeTitle($type)
 {
     $this->storage->setType($type);
     if ($type) {
         $titles = Storage::getTypeTitles();
         $this->assertEquals($titles[$type], $this->storage->getTypeTitle());
     } else {
         $this->assertEmpty($this->storage->getTypeTitle());
     }
 }
Пример #2
0
 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', null, ['label' => 'Name'])->add('path', new LocalPathField(), ['label' => 'Path', 'required' => false, 'attr' => ['placeholder' => Filesystem::getUserHomeDir()]])->add('type', 'choice', ['choices' => StorageEntity::getTypeTitles(), 'label' => 'Type'])->add('description', null, ['label' => 'Description']);
 }