示例#1
0
 public function testHasTypeAfterAdding()
 {
     $type = new FooType();
     $resolvedType = $this->registry->resolveType($type);
     $this->assertFalse($this->registry->hasType('foo'));
     $this->registry->addType($resolvedType);
     $this->assertTrue($this->registry->hasType('foo'));
 }
示例#2
0
 public function testHasTypeAfterAdding()
 {
     $resolvedType = $this->getMock('Symfony\\Component\\Form\\ResolvedFormTypeInterface');
     $resolvedType->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $this->assertFalse($this->registry->hasType('foo'));
     $this->registry->addType($resolvedType);
     $this->assertTrue($this->registry->hasType('foo'));
 }
 public function testHasTypeAfterAdding()
 {
     $resolvedType = $this->getMock('Symfony\\Component\\Form\\ResolvedFormTypeInterface');
     $resolvedType->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $this->assertFalse($this->registry->hasType('foo'));
     set_error_handler(array('Symfony\\Component\\Form\\Test\\DeprecationErrorHandler', 'handle'));
     $this->registry->addType($resolvedType);
     restore_error_handler();
     $this->assertTrue($this->registry->hasType('foo'));
 }