public function testHasTypeAfterLoadingFromExtension()
 {
     $type = new FooType();
     $this->assertFalse($this->registry->hasType('foo'));
     $this->extension2->addType($type);
     $this->assertTrue($this->registry->hasType('foo'));
 }
Exemple #2
0
 public function testLegacyHasTypeAfterLoadingFromExtension()
 {
     $type = new LegacyFooType();
     $resolvedType = new ResolvedFormType($type);
     $this->resolvedTypeFactory->expects($this->once())->method('createResolvedType')->with($type)->willReturn($resolvedType);
     $this->extension2->addType($type);
     $this->assertTrue($this->registry->hasType('foo'));
 }
Exemple #3
0
 public function testHasTypeAfterLoadingFromExtension()
 {
     $type = new FooType();
     $resolvedType = $this->getMock('Symfony\\Component\\Form\\ResolvedFormTypeInterface');
     $this->resolvedTypeFactory->expects($this->once())->method('createResolvedType')->with($type)->will($this->returnValue($resolvedType));
     $resolvedType->expects($this->any())->method('getName')->will($this->returnValue('foo'));
     $this->assertFalse($this->registry->hasType('foo'));
     $this->extension2->addType($type);
     $this->assertTrue($this->registry->hasType('foo'));
 }
 public function testDoesNotHaveTypeIfNoFormType()
 {
     $this->assertFalse($this->registry->hasType('stdClass'));
 }