public function ContentTranslationSettingsApiTest::testSettingsApi in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationSettingsApiTest::testSettingsApi()
- 9 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\KernelCode
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.');
}