InstallerCustomConfigDirectoryCreateTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Drupal\FunctionalTests\Installer;
  3. use Drupal\Core\Site\Settings;
  4. /**
  5. * Tests the installer when a custom config_directory set up but does not exist.
  6. *
  7. * @group Installer
  8. * @group legacy
  9. */
  10. class InstallerCustomConfigDirectoryCreateTest extends InstallerTestBase {
  11. /**
  12. * {@inheritdoc}
  13. */
  14. protected $defaultTheme = 'stark';
  15. /**
  16. * {@inheritdoc}
  17. */
  18. protected function prepareEnvironment() {
  19. parent::prepareEnvironment();
  20. // Other directories will be created too.
  21. // This is legacy functionality.
  22. $this->settings['config_directories']['custom'] = (object) [
  23. 'value' => $this->publicFilesDirectory . '/config_custom',
  24. 'required' => TRUE,
  25. ];
  26. }
  27. /**
  28. * Verifies that installation succeeded.
  29. *
  30. * @expectedDeprecation Automatic creation of 'custom' configuration directory will be removed from drupal:9.0.0. See https://www.drupal.org/node/3018145.
  31. */
  32. public function testInstaller() {
  33. $this->assertUrl('user/1');
  34. $this->assertResponse(200);
  35. $this->assertDirectoryExists($this->publicFilesDirectory . '/config_custom');
  36. // Ensure the sync directory also exists.
  37. $sync_directory = Settings::get('config_sync_directory');
  38. $this->assertDirectoryExists($sync_directory);
  39. }
  40. }