Version 1
[yaffs-website] / web / core / modules / system / tests / fixtures / update / drupal-8.editor-editor_update_8001.php
1 <?php
2
3 /**
4  * @file
5  * Contains database additions to drupal-8.bare.standard.php.gz for testing the
6  * upgrade path of editor_update_8001().
7  */
8
9 use Drupal\Core\Database\Database;
10
11 $connection = Database::getConnection();
12
13 // Simulate an un-synchronized environment.
14
15 // Disable the 'basic_html' editor.
16 $data = $connection->select('config')
17   ->fields('config', ['data'])
18   ->condition('name', 'editor.editor.basic_html')
19   ->execute()
20   ->fetchField();
21 $data = unserialize($data);
22 $data['status'] = FALSE;
23 $connection->update('config')
24   ->fields(['data' => serialize($data)])
25   ->condition('name', 'editor.editor.basic_html')
26   ->execute();
27
28 // Disable the 'full_html' text format.
29 $data = $connection->select('config')
30   ->fields('config', ['data'])
31   ->condition('name', 'filter.format.full_html')
32   ->execute()
33   ->fetchField();
34 $data = unserialize($data);
35 $data['status'] = FALSE;
36 $connection->update('config')
37   ->fields(['data' => serialize($data)])
38   ->condition('name', 'filter.format.full_html')
39   ->execute();