You are here

protected function KernelTransactionTestBase::prepareTransactionOperation in Transaction 8

Creates and initializes a transaction operation to be tested.

1 call to KernelTransactionTestBase::prepareTransactionOperation()
KernelTransactionTestBase::setUp in tests/src/Kernel/KernelTransactionTestBase.php

File

tests/src/Kernel/KernelTransactionTestBase.php, line 111

Class

KernelTransactionTestBase
Base class for kernel tests of the Transaction module.

Namespace

Drupal\Tests\transaction\Kernel

Code

protected function prepareTransactionOperation() {
  $this->transactionOperation = TransactionOperation::create([
    'id' => 'test_operation',
    'transaction_type' => $this->transactionType
      ->id(),
    'description' => '[transaction:type] #[transaction:id]',
    'details' => [
      'Executed by UID: [transaction:executor:target_id]',
      'Transaction UUID: [transaction:uuid]',
    ],
  ]);
  $this->transactionOperation
    ->save();
}