class ContentTranslationSettingsApiTest 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
- 9 core/modules/content_translation/tests/src/Kernel/ContentTranslationSettingsApiTest.php \Drupal\Tests\content_translation\Kernel\ContentTranslationSettingsApiTest
Tests the content translation settings API.
@group content_translation
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \PHPUnit\Framework\TestCase implements ServiceProviderInterface uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, AssertContentTrait, ConfigTestTrait, ExtensionListTestTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings
- class \Drupal\Tests\content_translation\Kernel\ContentTranslationSettingsApiTest
Expanded class hierarchy of ContentTranslationSettingsApiTest
File
- core/
modules/ content_translation/ tests/ src/ Kernel/ ContentTranslationSettingsApiTest.php, line 13
Namespace
Drupal\Tests\content_translation\KernelView source
class ContentTranslationSettingsApiTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'language',
'content_translation',
'user',
'entity_test',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('entity_test_mul');
}
/**
* Tests that enabling translation via the API triggers schema updates.
*/
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.');
}
}