You are here

protected function GenericTransactionTest::prepareTransactionType in Transaction 8

Creates a generic transaction type.

Overrides KernelTransactionTestBase::prepareTransactionType

File

tests/src/Kernel/GenericTransactionTest.php, line 18

Class

GenericTransactionTest
Tests the generic transactor.

Namespace

Drupal\Tests\transaction\Kernel

Code

protected function prepareTransactionType() {
  $this->transactionType = TransactionType::create([
    'id' => 'test_generic',
    'label' => 'Test generic',
    'target_entity_type' => 'entity_test',
    'transactor' => [
      'id' => 'transaction_generic',
      'settings' => [
        'last_transaction' => 'field_last_transaction',
        'log_message' => 'field_log_message',
      ],
    ],
  ]);
  $this->transactionType
    ->save();

  // Adds the test log message field.
  $this
    ->addTransactionLogMessageField();
}