protected function BalanceTransactionTest::prepareTargetEntityBalanceField in Transaction 8
Creates the balance field in the target entity type.
1 call to BalanceTransactionTest::prepareTargetEntityBalanceField()
- BalanceTransactionTest::prepareTransactionType in tests/
src/ Kernel/ BalanceTransactionTest.php - Creates and initializes the transaction type to be tested.
File
- tests/
src/ Kernel/ BalanceTransactionTest.php, line 85
Class
- BalanceTransactionTest
- Tests the balance transactor.
Namespace
Drupal\Tests\transaction\KernelCode
protected function prepareTargetEntityBalanceField() {
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_balance',
'type' => 'decimal',
'entity_type' => 'entity_test',
]);
$field_storage
->save();
FieldConfig::create([
'label' => 'Balance',
'field_storage' => $field_storage,
'bundle' => 'entity_test',
])
->save();
}