public function setUp($useReflection = true, $useAnnotations = true, Cache $cache = null) { parent::setUp(); $builder = new ContainerBuilder(); $builder->useReflection($useReflection)->useAnnotations($useAnnotations); if (!is_null($cache)) { $builder->setDefinitionCache($cache); } $this->DIContainer = $builder->build(); $this->registerMocks(); }