示例#1
0
文件: TypeTest.php 项目: php-lug/lug
 public function testConfigureOptions()
 {
     $resolver = $this->createOptionsResolverMock();
     $resolver->expects($this->never())->method('setDefined');
     $resolver->expects($this->never())->method('setDefault');
     $resolver->expects($this->never())->method('setDefaults');
     $this->type->configureOptions($resolver);
 }
示例#2
0
文件: LinkType.php 项目: php-lug/lug
 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(['route_parameters' => [], 'route_reference_type' => UrlGeneratorInterface::ABSOLUTE_PATH])->setRequired('route')->setAllowedTypes('route', 'string')->setAllowedTypes('route_parameters', 'array')->setAllowedValues('route_reference_type', [UrlGeneratorInterface::ABSOLUTE_PATH, UrlGeneratorInterface::ABSOLUTE_URL, UrlGeneratorInterface::NETWORK_PATH, UrlGeneratorInterface::RELATIVE_PATH]);
 }