Mercurial > hg > isophonics-drupal-site
comparison core/modules/file/src/Tests/Update/FileUpdateTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\file\Tests\Update; | |
4 | |
5 use Drupal\system\Tests\Update\UpdatePathTestBase; | |
6 | |
7 /** | |
8 * Tests File update path. | |
9 * | |
10 * @group file | |
11 */ | |
12 class FileUpdateTest extends UpdatePathTestBase { | |
13 | |
14 /** | |
15 * Modules to enable after the database is loaded. | |
16 */ | |
17 protected static $modules = ['file']; | |
18 | |
19 /** | |
20 * {@inheritdoc} | |
21 */ | |
22 protected function setDatabaseDumpFiles() { | |
23 $this->databaseDumpFiles = [ | |
24 __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', | |
25 __DIR__ . '/../../../tests/fixtures/update/drupal-8.file_formatters_update_2677990.php', | |
26 ]; | |
27 } | |
28 | |
29 /** | |
30 * Tests file_update_8001(). | |
31 */ | |
32 public function testPostUpdate8001() { | |
33 $view = 'core.entity_view_display.node.article.default'; | |
34 | |
35 // Check that field_file_generic formatter has no | |
36 // use_description_as_link_text setting. | |
37 $formatter_settings = $this->config($view)->get('content.field_file_generic_2677990.settings'); | |
38 $this->assertTrue(!isset($formatter_settings['use_description_as_link_text'])); | |
39 | |
40 // Check that field_file_table formatter has no use_description_as_link_text | |
41 // setting. | |
42 $formatter_settings = $this->config($view)->get('content.field_file_table_2677990.settings'); | |
43 $this->assertTrue(!isset($formatter_settings['use_description_as_link_text'])); | |
44 | |
45 // Run updates. | |
46 $this->runUpdates(); | |
47 | |
48 // Check that field_file_generic formatter has a | |
49 // use_description_as_link_text setting which value is TRUE. | |
50 $formatter_settings = $this->config($view)->get('content.field_file_generic_2677990.settings'); | |
51 $this->assertEqual($formatter_settings, ['use_description_as_link_text' => TRUE]); | |
52 | |
53 // Check that field_file_table formatter has a use_description_as_link_text | |
54 // setting which value is FALSE. | |
55 $formatter_settings = $this->config($view)->get('content.field_file_table_2677990.settings'); | |
56 $this->assertEqual($formatter_settings, ['use_description_as_link_text' => FALSE]); | |
57 } | |
58 | |
59 } |