You are here

public function TestingDataManager::__construct in Forena Reports 8

Create object for testing

Overrides DataManager::__construct

File

tests/src/Unit/Mock/TestingDataManager.php, line 17

Class

TestingDataManager

Namespace

Drupal\Tests\forena\Unit\Mock

Code

public function __construct() {
  $path = dirname(dirname(dirname(dirname(__FILE__))));
  $this->repositories = [
    'test' => [
      'source' => "{$path}/data",
      'driver' => 'FrxFiles',
      'title' => 'Test Data',
      'access callback' => array(
        $this,
        'checkAccess',
      ),
    ],
  ];
  $this->app = TestingAppService::instance();
  $this->app->data_directory = "{$path}/data_overriden";
  $this->dataSvc = new DataContext();
  $this->dataSvc
    ->setContext('site', $this->app->siteContext);
}