You are here

class TestingDataManager in Forena Reports 8

Hierarchy

Expanded class hierarchy of TestingDataManager

4 files declare their use of TestingDataManager
AReportTokenTest.php in tests/src/Unit/AReportTokenTest.php
DataManagerTest.php in tests/src/Unit/DataManagerTest.php
Implements DataManagerTest
FrxTestCase.php in tests/src/Unit/FrxTestCase.php
ReportFileSystemTest.php in tests/src/Unit/File/ReportFileSystemTest.php
Implements ReportFileSystemTest

File

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

Namespace

Drupal\Tests\forena\Unit\Mock
View source
class TestingDataManager extends DataManager {

  /**
   * Create object for testing
   */
  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);
  }

  /**
   * Allows access comments
   *
   * @param string $right
   *   The security object to test
   * @return bool
   *   Whether users should have access to the block.
   */
  public function checkaccess($right = '') {
    return boolval($right);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DataManager::$app public property
DataManager::$dataSvc public property
DataManager::$drivers public property
DataManager::$instance protected static property
DataManager::$repositories public property
DataManager::blockAccess function Check access control using the block in a data block. In this case public assess returns true.
DataManager::buildSQL public function Build an SQL statement from the data provider
DataManager::createDataSource public function Load the driver class based on the class name.
DataManager::data function Extract the data by running a block
DataManager::dataBlockParams function
DataManager::deleteBlock public function Save a data block ...
DataManager::instance public static function Returns the Data Manager instance.
DataManager::listRepos public function
DataManager::loadBlock public function Load Block Enter description here ...
DataManager::loadRepositoryConfig protected function
DataManager::repository public function Load repository
DataManager::saveBlock public function Save a data block ...
DataManager::sqlBlock public function Parse a block into its data
DataManager::sqlData public function Execute sql on a provider
TestingDataManager::checkaccess public function Allows access comments
TestingDataManager::__construct public function Create object for testing Overrides DataManager::__construct