getType() публичный Метод

This methods registers the type extensions from the form extensions.
Устаревший: Deprecated since version 2.1, to be removed in 2.3. Use {@link FormRegistryInterface::getType()} instead.
public getType ( string $name ) : Symfony\Component\Form\FormTypeInterface
$name string The name of the type
Результат Symfony\Component\Form\FormTypeInterface The type
Пример #1
0
 public function testGetType()
 {
     $type = new FooType();
     $resolvedType = $this->getMockResolvedType();
     $resolvedType->expects($this->once())->method('getInnerType')->will($this->returnValue($type));
     $this->registry->expects($this->once())->method('getType')->with('name')->will($this->returnValue($resolvedType));
     $this->assertEquals($type, $this->factory->getType('name'));
 }
Пример #2
0
 public function testGetType()
 {
     $type = new FooType();
     $resolvedType = $this->getMockResolvedType();
     $resolvedType->expects($this->once())->method('getInnerType')->will($this->returnValue($type));
     $this->registry->expects($this->once())->method('getType')->with('name')->will($this->returnValue($resolvedType));
     set_error_handler(array('Symfony\\Component\\Form\\Test\\DeprecationErrorHandler', 'handle'));
     $this->assertEquals($type, $this->factory->getType('name'));
     restore_error_handler();
 }