function SharedDatabaseStateTest::readProbes

Reads the probe table.

Return value

list<array<string, string>> The rows, ordered by identifier.

3 calls to SharedDatabaseStateTest::readProbes()
SharedDatabaseStateTest::testFirst in core/tests/Drupal/KernelTests/SharedDatabaseStateTest.php
Initial test method.
SharedDatabaseStateTest::testNothingWasRestored in core/tests/Drupal/KernelTests/SharedDatabaseStateTest.php
Tests that nothing the previous test method did was undone.
SharedDatabaseStateTest::testStateIsWritable in core/tests/Drupal/KernelTests/SharedDatabaseStateTest.php
Tests that a test method can change the shared state.

File

core/tests/Drupal/KernelTests/SharedDatabaseStateTest.php, line 167

Class

SharedDatabaseStateTest
Tests the shared database state of Drupal\KernelTests\KernelTestBase.

Namespace

Drupal\KernelTests

Code

private function readProbes() : array {
  $rows = [];
  $result = $this->container
    ->get('database')
    ->select(self::PROBE_TABLE, 'p')
    ->fields('p', [
    'id',
    'name',
  ])
    ->orderBy('id')
    ->execute();
  foreach ($result as $row) {
    $rows[] = [
      'id' => (string) $row->id,
      'name' => $row->name,
    ];
  }
  return $rows;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.