/** * @return FormTypeGuesserInterface */ protected function getFormTypeGuesser() { if (!$this->formTypeGuesser) { $this->formTypeGuesser = $this->formRegistry->getTypeGuesser(); } return $this->formTypeGuesser; }
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; }
public function testGetTypeGuesser() { $expectedGuesser = new FormTypeGuesserChain(array($this->guesser1, $this->guesser2)); $this->assertEquals($expectedGuesser, $this->registry->getTypeGuesser()); }