I am testing a Form Type I defined for an application. During testing the form type, using symfony\'s TypeTestCase class a message \"Could not load type \"entity\"\" appears. Wh
The Ahmed Siouani's answer is well writted and allowed me to understand how to add an Extension in the TypeTestCase.
But if you want to make an Intergration test, who is much simpler than a Unit test in this case, you can do as follow:
protected function getExtensions()
{
$childType = new TestChildType();
return array(new PreloadedExtension(array(
$childType->getName() => $childType,
), array()));
}
As described in this documentation: http://symfony.com/doc/current/cookbook/form/unit_testing.html#adding-a-type-your-form-depends-on