function SharedDatabaseStateTest::readProbes

Same name and namespace in other branches
  1. main core/tests/Drupal/KernelTests/SharedDatabaseStateTest.php \Drupal\KernelTests\SharedDatabaseStateTest::readProbes()

Reads the probe table.

Return value

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

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.