You are here

public function ConnectionTest::providerTestPrefixTables in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Database/ConnectionTest.php \Drupal\Tests\Core\Database\ConnectionTest::providerTestPrefixTables()

Dataprovider for testPrefixTables().

Return value

array Array of arrays with the following elements:

  • Expected result.
  • Table prefix.
  • Query to be prefixed.

File

core/tests/Drupal/Tests/Core/Database/ConnectionTest.php, line 78
Contains \Drupal\Tests\Core\Database\ConnectionTest.

Class

ConnectionTest
Tests the Connection class.

Namespace

Drupal\Tests\Core\Database

Code

public function providerTestPrefixTables() {
  return array(
    array(
      'SELECT * FROM test_table',
      'test_',
      'SELECT * FROM {table}',
    ),
    array(
      'SELECT * FROM first_table JOIN second_thingie',
      array(
        'table' => 'first_',
        'thingie' => 'second_',
      ),
      'SELECT * FROM {table} JOIN {thingie}',
    ),
  );
}