/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     mkdir($this->siteDirectory . '/config_read_only', 0444);
     $this->expectedFilePerms = fileperms($this->siteDirectory . '/config_read_only');
     $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) array('value' => $this->siteDirectory . '/config_read_only', 'required' => TRUE);
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUpLanguage()
 {
     // Place custom local translations in the translations directory.
     mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
     file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.es.po', $this->getPo('es'));
     parent::setUpLanguage();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUpLanguage()
 {
     // Place custom local translations in the translations directory.
     mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.eo.po', $this->getPo('eo'));
     parent::setUpLanguage();
     $this->translations['Save and continue'] = 'Save and continue eo';
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->syncDirectory = $this->publicFilesDirectory . '/config_' . Crypt::randomBytesBase64() . '/sync';
     $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) array('value' => $this->syncDirectory, 'required' => TRUE);
     // Other directories will be created too.
     $this->settings['config_directories']['custom'] = (object) array('value' => $this->publicFilesDirectory . '/config_custom', 'required' => TRUE);
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUpLanguage()
 {
     // Place custom local translations in the translations directory.
     mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue German\"");
     file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.es.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue Spanish\"");
     parent::setUpLanguage();
 }
Пример #6
0
 /**
  * Installer step: Select language.
  */
 protected function setUpLanguage()
 {
     // Test that \Drupal\Core\Render\BareHtmlPageRenderer adds assets and
     // metatags as expected to the first page of the installer.
     $this->assertRaw('core/themes/seven/css/components/buttons.css');
     $this->assertRaw('<meta charset="utf-8" />');
     parent::setUpLanguage();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->info = array('type' => 'profile', 'core' => \Drupal::CORE_COMPATIBILITY, 'name' => 'Distribution profile', 'distribution' => array('name' => 'My Distribution', 'langcode' => $this->langcode, 'install' => array('theme' => 'bartik')));
     // File API functions are not available yet.
     $path = $this->siteDirectory . '/profiles/mydistro';
     mkdir($path, 0777, TRUE);
     file_put_contents("{$path}/mydistro.info.yml", Yaml::encode($this->info));
     parent::setUp();
 }
 /**
  * @{inheritdoc}
  */
 protected function setUpSettings()
 {
     // We are creating a table here to force an error in the installer because
     // it will try and create the drupal_install_test table as this is part of
     // the standard database tests performed by the installer in
     // Drupal\Core\Database\Install\Tasks.
     Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NULL)');
     parent::setUpSettings();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     // Pre-configure database credentials in settings.php.
     $connection_info = Database::getConnectionInfo();
     unset($connection_info['default']['pdo']);
     unset($connection_info['default']['init_commands']);
     $this->settings['databases']['default'] = (object) array('value' => $connection_info, 'required' => TRUE);
     parent::setUp();
 }
 protected function setUp()
 {
     $this->info = array('type' => 'profile', 'core' => \Drupal::CORE_COMPATIBILITY, 'name' => 'Override standard', 'hidden' => TRUE);
     // File API functions are not available yet.
     $path = $this->siteDirectory . '/profiles/standard';
     mkdir($path, 0777, TRUE);
     file_put_contents("{$path}/standard.info.yml", Yaml::encode($this->info));
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->configDirectory = $this->publicFilesDirectory . '/config_' . Crypt::randomBytesBase64();
     $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) array('value' => $this->configDirectory . '/sync', 'required' => TRUE);
     // Create the files directory early so we can test the error case.
     mkdir($this->publicFilesDirectory);
     // Create a file so the directory can not be created.
     file_put_contents($this->configDirectory, 'Test');
     parent::setUp();
 }
 /**
  * Overrides InstallerTest::setUpLanguage().
  */
 protected function setUpLanguage()
 {
     // Verify that the distribution name appears.
     $this->assertRaw($this->info['distribution']['name']);
     // Verify that the requested theme is used.
     $this->assertRaw($this->info['distribution']['install']['theme']);
     // Verify that the "Choose profile" step does not appear.
     $this->assertNoText('profile');
     parent::setUpLanguage();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUpLanguage()
 {
     // Place a custom local translation in the translations directory.
     mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.ar.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue Arabic\"");
     parent::setUpLanguage();
     // After selecting a different language than English, all following screens
     // should be translated already.
     $elements = $this->xpath('//input[@type="submit"]/@value');
     $this->assertEqual((string) current($elements), 'Save and continue Arabic');
     $this->translations['Save and continue'] = 'Save and continue Arabic';
     // Verify that language direction is right-to-left.
     $direction = (string) current($this->xpath('/html/@dir'));
     $this->assertEqual($direction, 'rtl');
 }
 /**
  * {@inheritdoc}
  *
  * Configures a preexisting settings.php file without an install_profile
  * setting before invoking the interactive installer.
  */
 protected function setUp()
 {
     // Pre-configure hash salt.
     // Any string is valid, so simply use the class name of this test.
     $this->settings['settings']['hash_salt'] = (object) array('value' => __CLASS__, 'required' => TRUE);
     // Pre-configure database credentials.
     $connection_info = Database::getConnectionInfo();
     unset($connection_info['default']['pdo']);
     unset($connection_info['default']['init_commands']);
     $this->settings['databases']['default'] = (object) array('value' => $connection_info, 'required' => TRUE);
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(CONFIG_SYNC_DIRECTORY => (object) array('value' => DrupalKernel::findSitePath(Request::createFromGlobals()) . '/files/config_sync', 'required' => TRUE));
     mkdir($this->settings['config_directories'][CONFIG_SYNC_DIRECTORY]->value, 0777, TRUE);
     parent::setUp();
 }
 /**
  * Overrides InstallerTest::setUpLanguage().
  */
 protected function setUpLanguage()
 {
     // Place a custom local translation in the translations directory.
     mkdir(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     file_put_contents(DRUPAL_ROOT . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', "msgid \"\"\nmsgstr \"\"\nmsgid \"Save and continue\"\nmsgstr \"Save and continue German\"");
     parent::setUpLanguage();
     // After selecting a different language than English, all following screens
     // should be translated already.
     $elements = $this->xpath('//input[@type="submit"]/@value');
     $this->assertEqual((string) current($elements), 'Save and continue German');
     $this->translations['Save and continue'] = 'Save and continue German';
     // Check the language direction.
     $direction = (string) current($this->xpath('/html/@dir'));
     $this->assertEqual($direction, 'ltr');
 }
 /**
  * @{inheritdoc}
  */
 protected function setUpSettings()
 {
     // We are creating a table here to force an error in the installer because
     // it will try and create the drupal_install_test table as this is part of
     // the standard database tests performed by the installer in
     // Drupal\Core\Database\Install\Tasks.
     Database::getConnection('default')->query('CREATE TABLE {drupal_install_test} (id int NULL)');
     parent::setUpSettings();
     // Ensure that the error message translation is working.
     $this->assertRaw('Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der <a href="https://www.drupal.org/getting-started/install">Installationshandbuch</a>, oder kontaktieren Sie Ihren Hosting-Anbieter.');
     $this->assertRaw('<strong>CREATE</strong> ein Test-Tabelle auf Ihrem Datenbankserver mit dem Befehl <em class="placeholder">CREATE TABLE {drupal_install_test} (id int NULL)</em> fehlgeschlagen.');
     // Now do it successfully.
     Database::getConnection('default')->query('DROP TABLE {drupal_install_test}');
     parent::setUpSettings();
 }
Пример #17
0
 /**
  * Installer step: Select language.
  */
 protected function setUpLanguage()
 {
     // Place a custom local translation in the translations directory.
     mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     touch(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.xoxo.po');
     // Check that all predefined languages show up with their native names.
     $this->drupalGet($GLOBALS['base_url'] . '/core/install.php');
     foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) {
         $this->assertOption('edit-langcode', $langcode);
         $this->assertRaw('>' . $names[1] . '<');
     }
     // Check that our custom one shows up with the file name indicated language.
     $this->assertOption('edit-langcode', 'xoxo');
     $this->assertRaw('>xoxo<');
     parent::setUpLanguage();
 }
 /**
  * {@inheritdoc}
  *
  * Configures a preexisting settings.php file without an install_profile
  * setting before invoking the interactive installer.
  */
 protected function setUp()
 {
     // Pre-configure hash salt.
     // Any string is valid, so simply use the class name of this test.
     $this->settings['settings']['hash_salt'] = (object) array('value' => __CLASS__, 'required' => TRUE);
     // Pre-configure database credentials.
     $connection_info = Database::getConnectionInfo();
     unset($connection_info['default']['pdo']);
     unset($connection_info['default']['init_commands']);
     $this->settings['databases']['default'] = (object) array('value' => $connection_info, 'required' => TRUE);
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(CONFIG_ACTIVE_DIRECTORY => (object) array('value' => conf_path() . '/files/config_active', 'required' => TRUE), CONFIG_STAGING_DIRECTORY => (object) array('value' => conf_path() . '/files/config_staging', 'required' => TRUE));
     mkdir($this->settings['config_directories'][CONFIG_ACTIVE_DIRECTORY]->value, 0777, TRUE);
     mkdir($this->settings['config_directories'][CONFIG_STAGING_DIRECTORY]->value, 0777, TRUE);
     parent::setUp();
 }
 /**
  * Overrides InstallerTest::setUpLanguage().
  */
 protected function setUpLanguage()
 {
     parent::setUpLanguage();
     // After selecting a different language than English, all following screens
     // should be translated already.
     // @todo Instead of actually downloading random translations that cannot be
     //   asserted, write and supply a German translation file. Until then, take
     //   over whichever string happens to be there, but ensure that the English
     //   string no longer appears.
     $elements = $this->xpath('//input[@type="submit"]/@value');
     $string = (string) current($elements);
     $this->assertNotEqual($string, 'Save and continue');
     $this->translations['Save and continue'] = $string;
     // Check the language direction.
     $direction = (string) current($this->xpath('/html/@dir'));
     $this->assertEqual($direction, 'ltr');
 }
 /**
  * {@inheritdoc}
  */
 protected function visitInstaller()
 {
     // Place a custom local translation in the translations directory.
     mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
     file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
     parent::visitInstaller();
     // The language should have been automatically detected, all following
     // screens should be translated already.
     $elements = $this->xpath('//input[@type="submit"]/@value');
     $this->assertEqual((string) current($elements), 'Save and continue de');
     $this->translations['Save and continue'] = 'Save and continue de';
     // Check the language direction.
     $direction = (string) current($this->xpath('/html/@dir'));
     $this->assertEqual($direction, 'ltr');
     // Verify that the distribution name appears.
     $this->assertRaw($this->info['distribution']['name']);
     // Verify that the requested theme is used.
     $this->assertRaw($this->info['distribution']['install']['theme']);
     // Verify that the "Choose profile" step does not appear.
     $this->assertNoText('profile');
 }
 /**
  * {@inheritdoc}
  *
  * Fully configures a preexisting settings.php file before invoking the
  * interactive installer.
  */
 protected function setUp()
 {
     // Pre-configure hash salt.
     // Any string is valid, so simply use the class name of this test.
     $this->settings['settings']['hash_salt'] = (object) array('value' => __CLASS__, 'required' => TRUE);
     // During interactive install we'll change this to a different profile and
     // this test will ensure that the new value is written to settings.php.
     $this->settings['settings']['install_profile'] = (object) array('value' => 'minimal', 'required' => TRUE);
     // Pre-configure database credentials.
     $connection_info = Database::getConnectionInfo();
     unset($connection_info['default']['pdo']);
     unset($connection_info['default']['init_commands']);
     $this->settings['databases']['default'] = (object) array('value' => $connection_info, 'required' => TRUE);
     // Use the kernel to find the site path because the site.path service should
     // not be available at this point in the install process.
     $site_path = DrupalKernel::findSitePath(Request::createFromGlobals());
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(CONFIG_SYNC_DIRECTORY => (object) array('value' => $site_path . '/files/config_sync', 'required' => TRUE));
     mkdir($this->settings['config_directories'][CONFIG_SYNC_DIRECTORY]->value, 0777, TRUE);
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  *
  * Fully configures a preexisting settings.php file before invoking the
  * interactive installer.
  */
 protected function setUp()
 {
     // Pre-configure hash salt.
     // Any string is valid, so simply use the class name of this test.
     $this->settings['settings']['hash_salt'] = (object) array('value' => __CLASS__, 'required' => TRUE);
     // Actually the install profile should be skipped to because it is written
     // to settings.php.
     // @todo https://www.drupal.org/node/2451369 Fix install_profile so that it
     //   is written to an existing settings.php if possible or if set used.
     $this->settings['settings']['install_profile'] = (object) array('value' => 'testing', 'required' => TRUE);
     // Pre-configure database credentials.
     $connection_info = Database::getConnectionInfo();
     unset($connection_info['default']['pdo']);
     unset($connection_info['default']['init_commands']);
     $this->settings['databases']['default'] = (object) array('value' => $connection_info, 'required' => TRUE);
     // Pre-configure config directories.
     $this->settings['config_directories'] = array(CONFIG_ACTIVE_DIRECTORY => (object) array('value' => conf_path() . '/files/config_active', 'required' => TRUE), CONFIG_STAGING_DIRECTORY => (object) array('value' => conf_path() . '/files/config_staging', 'required' => TRUE));
     mkdir($this->settings['config_directories'][CONFIG_ACTIVE_DIRECTORY]->value, 0777, TRUE);
     mkdir($this->settings['config_directories'][CONFIG_STAGING_DIRECTORY]->value, 0777, TRUE);
     parent::setUp();
 }
 protected function setUp()
 {
     // Copy the testing_config_overrides install profile so we can change the
     // configuration to include a dependency that can not be met. File API
     // functions are not available yet.
     $dest = $this->siteDirectory . '/profiles/testing_config_overrides';
     mkdir($dest, 0777, TRUE);
     $source = DRUPAL_ROOT . '/core/profiles/testing_config_overrides';
     $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
     foreach ($iterator as $item) {
         if ($item->isDir()) {
             mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
         } else {
             copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
         }
     }
     // Add a dependency that can not be met because User is installed before
     // Action.
     $config_file = $dest . DIRECTORY_SEPARATOR . InstallStorage::CONFIG_INSTALL_DIRECTORY . DIRECTORY_SEPARATOR . 'system.action.user_block_user_action.yml';
     $action = Yaml::decode(file_get_contents($config_file));
     $action['dependencies']['module'][] = 'action';
     file_put_contents($config_file, Yaml::encode($action));
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     // Create an empty settings.php file.
     touch($this->siteDirectory . '/settings.php');
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) array('value' => $this->siteDirectory . '/config', 'required' => TRUE);
     parent::setUp();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUpLanguage()
 {
     // Verify that the distribution name appears.
     $this->assertRaw('thunder');
     // Verify that the "Choose profile" step does not appear.
     $this->assertNoText('profile');
     parent::setUpLanguage();
 }
Пример #28
0
 /**
  * {@inheritdoc}
  */
 protected function setUpSite()
 {
     // Assert that the expected title is present.
     $this->assertEqual('Configure site', $this->cssSelect('main h1')[0]);
     parent::setUpSite();
 }
Пример #29
0
 /**
  * {@inheritdoc}
  */
 protected function visitInstaller()
 {
     parent::visitInstaller();
     // Assert the title is correct and has the title suffix.
     $this->assertTitle('Choose language | Drupal');
 }