InstallerConfigDirectorySetNoDirectoryTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Drupal\FunctionalTests\Installer;
  3. use Drupal\Component\Utility\Crypt;
  4. /**
  5. * Tests the installer when a custom config directory set up but does not exist.
  6. *
  7. * @group Installer
  8. */
  9. class InstallerConfigDirectorySetNoDirectoryTest extends InstallerTestBase {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. protected $defaultTheme = 'stark';
  14. /**
  15. * The sync directory created during the install.
  16. *
  17. * @var string
  18. */
  19. protected $syncDirectory;
  20. /**
  21. * {@inheritdoc}
  22. */
  23. protected function prepareEnvironment() {
  24. parent::prepareEnvironment();
  25. $this->syncDirectory = $this->publicFilesDirectory . '/config_' . Crypt::randomBytesBase64() . '/sync';
  26. $this->settings['settings']['config_sync_directory'] = (object) [
  27. 'value' => $this->syncDirectory,
  28. 'required' => TRUE,
  29. ];
  30. }
  31. /**
  32. * Verifies that installation succeeded.
  33. */
  34. public function testInstaller() {
  35. $this->assertUrl('user/1');
  36. $this->assertSession()->statusCodeEquals(200);
  37. $this->assertDirectoryExists($this->syncDirectory);
  38. }
  39. }