Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / content_translation / tests / src / Kernel / ContentTranslationSettingsApiTest.php
1 <?php
2
3 namespace Drupal\Tests\content_translation\Kernel;
4
5 use Drupal\KernelTests\KernelTestBase;
6
7 /**
8  * Tests the content translation settings API.
9  *
10  * @group content_translation
11  */
12 class ContentTranslationSettingsApiTest extends KernelTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['language', 'content_translation', 'user', 'entity_test'];
20
21   /**
22    * {@inheritdoc}
23    */
24   protected function setUp() {
25     parent::setUp();
26     $this->installEntitySchema('entity_test_mul');
27   }
28
29   /**
30    * Tests that enabling translation via the API triggers schema updates.
31    */
32   public function testSettingsApi() {
33     $this->container->get('content_translation.manager')->setEnabled('entity_test_mul', 'entity_test_mul', TRUE);
34     $result =
35       db_field_exists('entity_test_mul_property_data', 'content_translation_source') &&
36       db_field_exists('entity_test_mul_property_data', 'content_translation_outdated');
37     $this->assertTrue($result, 'Schema updates correctly performed.');
38   }
39
40 }