addType() public method

Adds a type.
Deprecation: Deprecated since version 2.1, to be removed in 2.3. Use form extensions or type registration in the Dependency Injection Container instead.
public addType ( Symfony\Component\Form\FormTypeInterface $type )
$type Symfony\Component\Form\FormTypeInterface The type
Beispiel #1
0
 public function testAddType()
 {
     $type = new FooType();
     $resolvedType = $this->getMockResolvedType();
     $this->resolvedTypeFactory->expects($this->once())->method('createResolvedType')->with($type)->will($this->returnValue($resolvedType));
     $this->registry->expects($this->once())->method('addType')->with($resolvedType);
     $this->factory->addType($type);
 }
 public function testAddType()
 {
     $type = new FooType();
     $resolvedType = $this->getMockResolvedType();
     $this->resolvedTypeFactory->expects($this->once())->method('createResolvedType')->with($type)->will($this->returnValue($resolvedType));
     $this->registry->expects($this->once())->method('addType')->with($resolvedType);
     set_error_handler(array('Symfony\\Component\\Form\\Test\\DeprecationErrorHandler', 'handle'));
     $this->factory->addType($type);
     restore_error_handler();
 }