comparison core/modules/config/tests/src/Functional/ConfigInstallWebTest.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 7a779792577d
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
2 2
3 namespace Drupal\Tests\config\Functional; 3 namespace Drupal\Tests\config\Functional;
4 4
5 use Drupal\Core\Config\PreExistingConfigException; 5 use Drupal\Core\Config\PreExistingConfigException;
6 use Drupal\Core\Config\StorageInterface; 6 use Drupal\Core\Config\StorageInterface;
7 use Drupal\Core\File\Exception\FileException;
7 use Drupal\language\Entity\ConfigurableLanguage; 8 use Drupal\language\Entity\ConfigurableLanguage;
8 use Drupal\Tests\BrowserTestBase; 9 use Drupal\Tests\BrowserTestBase;
9 10
10 /** 11 /**
11 * Tests installation and removal of configuration objects in install, disable 12 * Tests installation and removal of configuration objects in install, disable
188 $this->assertRaw('Unable to install <em class="placeholder">Config install dependency test</em> due to unmet dependencies: <em class="placeholder">config_test.dynamic.other_module_test_with_dependency (config_other_module_config_test)</em>'); 189 $this->assertRaw('Unable to install <em class="placeholder">Config install dependency test</em> due to unmet dependencies: <em class="placeholder">config_test.dynamic.other_module_test_with_dependency (config_other_module_config_test)</em>');
189 190
190 $this->drupalPostForm('admin/modules', ['modules[config_other_module_config_test][enable]' => TRUE], t('Install')); 191 $this->drupalPostForm('admin/modules', ['modules[config_other_module_config_test][enable]' => TRUE], t('Install'));
191 $this->drupalPostForm('admin/modules', ['modules[config_install_dependency_test][enable]' => TRUE], t('Install')); 192 $this->drupalPostForm('admin/modules', ['modules[config_install_dependency_test][enable]' => TRUE], t('Install'));
192 $this->rebuildContainer(); 193 $this->rebuildContainer();
193 $this->assertTrue(entity_load('config_test', 'other_module_test_with_dependency'), 'The config_test.dynamic.other_module_test_with_dependency configuration has been created during install.'); 194 $this->assertTrue(\Drupal::entityTypeManager()->getStorage('config_test')->load('other_module_test_with_dependency'), 'The config_test.dynamic.other_module_test_with_dependency configuration has been created during install.');
194 } 195 }
195 196
196 /** 197 /**
197 * Tests config_requirements(). 198 * Tests config_requirements().
198 */ 199 */
199 public function testConfigModuleRequirements() { 200 public function testConfigModuleRequirements() {
200 $this->drupalLogin($this->adminUser); 201 $this->drupalLogin($this->adminUser);
201 $this->drupalPostForm('admin/modules', ['modules[config][enable]' => TRUE], t('Install')); 202 $this->drupalPostForm('admin/modules', ['modules[config][enable]' => TRUE], t('Install'));
202 203
203 $directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY); 204 $directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
204 file_unmanaged_delete_recursive($directory); 205 try {
206 \Drupal::service('file_system')->deleteRecursive($directory);
207 }
208 catch (FileException $e) {
209 // Ignore failed deletes.
210 }
205 $this->drupalGet('/admin/reports/status'); 211 $this->drupalGet('/admin/reports/status');
206 $this->assertRaw(t('The directory %directory does not exist.', ['%directory' => $directory])); 212 $this->assertRaw(t('The directory %directory does not exist.', ['%directory' => $directory]));
207 } 213 }
208 214
209 } 215 }