You are here

public function ContentTranslationSettingsApiTest::testSettingsApi in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationSettingsApiTest::testSettingsApi()

Tests that enabling translation via the API triggers schema updates.

File

core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php, line 38

Class

ContentTranslationSettingsApiTest
Tests the content translation settings API.

Namespace

Drupal\Tests\content_translation\Kernel

Code

public function testSettingsApi() {
  $this->container
    ->get('content_translation.manager')
    ->setEnabled('entity_test_mul', 'entity_test_mul', TRUE);
  $schema = Database::getConnection()
    ->schema();
  $result = $schema
    ->fieldExists('entity_test_mul_property_data', 'content_translation_source') && $schema
    ->fieldExists('entity_test_mul_property_data', 'content_translation_outdated');
  $this
    ->assertTrue($result, 'Schema updates correctly performed.');
}