<?php

namespace Drupal\Tests\dkan_common\Unit\Mocks;

use Drupal\Core\Database\Connection;
use Drupal\dkan_common\Storage\DatabaseConnectionFactory;

class DatabaseConnectionFactoryMock extends DatabaseConnectionFactory {

  protected Connection $connection;

  public function __construct(Connection $connection) {
    $this->connection = $connection;
  }

  public function getConnection(): Connection {
    $this->prepareConnection($this->connection);

    return $this->connection;
  }

}
