diff --git a/libraries/classes/Plugins/ExportPlugin.php b/libraries/classes/Plugins/ExportPlugin.php index 5c77114d06..234b0c5fd1 100644 --- a/libraries/classes/Plugins/ExportPlugin.php +++ b/libraries/classes/Plugins/ExportPlugin.php @@ -39,13 +39,14 @@ abstract class ExportPlugin implements Plugin /** @var Transformations */ protected $transformations; + /** + * @psalm-suppress InvalidArrayOffset, MixedAssignment, MixedMethodCall + */ final public function __construct() { - global $dbi; - - $this->relation = new Relation($dbi); - $this->export = new Export($dbi); - $this->transformations = new Transformations(); + $this->relation = $GLOBALS['containerBuilder']->get('relation'); + $this->export = $GLOBALS['containerBuilder']->get('export'); + $this->transformations = $GLOBALS['containerBuilder']->get('transformations'); $this->init(); $this->properties = $this->setProperties(); } diff --git a/test/classes/AbstractTestCase.php b/test/classes/AbstractTestCase.php index 8e44c67c96..45fdc9850a 100644 --- a/test/classes/AbstractTestCase.php +++ b/test/classes/AbstractTestCase.php @@ -89,6 +89,7 @@ abstract class AbstractTestCase extends TestCase $this->setGlobalConfig(); $this->loadContainerBuilder(); $this->setGlobalDbi(); + $this->loadDbiIntoContainerBuilder(); Cache::purge(); }