function TransactionTest::insertRow

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php \Drupal\KernelTests\Core\Database\TransactionTest::insertRow()

Inserts a single row into the testing table.

2 calls to TransactionTest::insertRow()
TransactionTest::testTransactionStacking in core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php
Tests transaction stacking, commit, and rollback.
TransactionTest::testTransactionWithDdlStatement in core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php
Tests the compatibility of transactions with DDL statements.

File

core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php, line 282

Class

TransactionTest
Tests the transaction abstraction system.

Namespace

Drupal\KernelTests\Core\Database

Code

protected function insertRow($name) {
    $this->connection
        ->insert('test')
        ->fields([
        'name' => $name,
    ])
        ->execute();
}

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