示例#1
0
 /**
  * @return FormTypeGuesserInterface
  */
 protected function getFormTypeGuesser()
 {
     if (!$this->formTypeGuesser) {
         $this->formTypeGuesser = $this->formRegistry->getTypeGuesser();
     }
     return $this->formTypeGuesser;
 }
示例#2
0
 public function testGetTypeGuesser()
 {
     $expectedGuesser = new FormTypeGuesserChain(array($this->guesser1, $this->guesser2));
     $this->assertEquals($expectedGuesser, $this->registry->getTypeGuesser());
     $registry = new FormRegistry(array($this->getMock('Symfony\\Component\\Form\\FormExtensionInterface')), $this->resolvedTypeFactory);
     $this->assertNull($registry->getTypeGuesser());
 }
 /**
  *
  * @param \Symfony\Component\Form\FormRegistry $formRegistry
  * @param \Doctrine\Common\Persistence\ManagerRegistry $managerRegistry
  */
 public function __construct(FormRegistry $formRegistry, ManagerRegistry $managerRegistry)
 {
     $this->typeGuesser = $formRegistry->getTypeGuesser();
     $this->managerRegistry = $managerRegistry;
 }
示例#4
0
 public function testGetTypeGuesser()
 {
     $expectedGuesser = new FormTypeGuesserChain(array($this->guesser1, $this->guesser2));
     $this->assertEquals($expectedGuesser, $this->registry->getTypeGuesser());
 }