fix tests

This commit is contained in:
2024-05-10 16:48:29 +02:00
parent 36ee1a5957
commit 69b33d3538
6 changed files with 33 additions and 20 deletions

View File

@ -149,8 +149,6 @@ abstract class ExportBase implements QueryBase
* @return array
* @throws DBALException
* @throws Exception
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function getExportData(array $query): array
{
@ -166,9 +164,7 @@ abstract class ExportBase implements QueryBase
);
}
/** @var Connection $connection */
$connection = ContainerFactory::getInstance()->getContainer()->get(ConnectionProviderInterface::class)->get();
$rows = $connection->executeQuery($queryString, $parameters)->fetchAllAssociative();
$rows = $this->getConnection()->executeQuery($queryString, $parameters)->fetchAllAssociative();
if (count($rows) <= 0) {
throw oxNew(
@ -183,6 +179,11 @@ abstract class ExportBase implements QueryBase
return [ $rows, $fieldNames ];
}
protected function getConnection(): Connection
{
return ContainerFactory::getInstance()->getContainer()->get(ConnectionProviderInterface::class)->get();
}
public function registerFormElement(Input $input): void
{
if ($input instanceof Radio || $input instanceof Checkbox) {