function TransactionTest::testDeprecationOfCommitAll

Same name and namespace in other branches
  1. main core/tests/Drupal/KernelTests/Core/Database/TransactionTest.php \Drupal\KernelTests\Core\Database\TransactionTest::testDeprecationOfCommitAll()

Tests deprecation of ::commitAll().

Attributes

#[IgnoreDeprecations]

File

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

Class

TransactionTest
Tests the transactions, using the explicit ::commitOrRelease method.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testDeprecationOfCommitAll() : void {
  $this->expectUserDeprecationMessage('Committing transactions via Drupal\\Core\\Database\\Transaction\\TransactionManagerBase::commitAll() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement. See https://www.drupal.org/node/3524461');
  $transaction = $this->createRootTransaction();
  $savepoint = $this->createFirstSavepointTransaction();
  $this->connection
    ->commitAll();
  $this->assertRowPresent('David');
  $this->assertRowPresent('Roger');
  unset($transaction, $savepoint);
}

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