function SharedDatabaseStateTest::insertProbe

Inserts a row into the probe table.

Parameters

string $name: The name to store.

3 calls to SharedDatabaseStateTest::insertProbe()
SharedDatabaseStateTest::setUpEnvironment in core/tests/Drupal/KernelTests/SharedDatabaseStateTest.php
Sets up the environment shared by every test method in this class.
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 155

Class

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

Namespace

Drupal\KernelTests

Code

private function insertProbe(string $name) : void {
  $this->container
    ->get('database')
    ->insert(self::PROBE_TABLE)
    ->fields([
    'name' => $name,
  ])
    ->execute();
}

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