assertErrorOutputContains example

$this->copyCodebase();
    $drupal_root = $this->getWorkspaceDirectory();

    // Set the core version.     Composer::setDrupalVersion($drupal_root$tag);
    $this->assertDrupalVersion($tag$drupal_root);

    // Emulate the release script.     // @see https://github.com/xjm/drupal_core_release/blob/main/tag.sh     $this->executeCommand("COMPOSER_ROOT_VERSION=\"$tag\" composer update drupal/core*");
    $this->assertCommandSuccessful();
    $this->assertErrorOutputContains('generateComponentPackages');

    // Find all the components.     $component_finder = $this->getComponentPathsFinder($drupal_root);

    // Loop through all the component packages.     /** @var \Symfony\Component\Finder\SplFileInfo $composer_json */
    foreach ($component_finder->getIterator() as $composer_json) {
      $composer_json_data = json_decode(file_get_contents($composer_json->getPathname()), TRUE);
      $requires = array_merge(
        $composer_json_data['require'] ?? [],
        $composer_json_data['require-dev'] ?? []
      );
$this->assertCommandSuccessful();
    // Check the output of the project creation for the absence of warnings     // about any non-allowed composer plugins.     // Note: There are different warnings for unallowed composer plugins     // depending on running in non-interactive mode or not. It seems the Drupal     // CI environment always forces composer commands to run in the     // non-interactive mode. The only thing these messages have in common is the     // following string.     $this->assertErrorOutputNotContains('See https://getcomposer.org/allow-plugins');

    // Ensure we used the project from our codebase.     $this->assertErrorOutputContains("Installing $project ($simulated_core_version): Symlinking from $package_dir");
    // Ensure that we used drupal/core from our codebase. This probably means     // that drupal/core-recommended was added successfully by the project.     $this->assertErrorOutputContains("Installing drupal/core ($simulated_core_version): Symlinking from");
    // Verify that there is an autoloader. This is written by the scaffold     // plugin, so its existence assures us that scaffolding happened.     $this->assertFileExists($autoloader);

    // Verify that the minimum stability in the installed composer.json file     // matches the stability of the simulated core version.     $this->assertFileExists($installed_composer_json);
    $composer_json_contents = file_get_contents($installed_composer_json);
    
/** * @covers ::instantiateServer */
  public function testHtRouter() {
    $sqlite = (new \PDO('sqlite::memory:'))->query('select sqlite_version()')->fetch()[0];
    if (version_compare($sqlite, Tasks::SQLITE_MINIMUM_VERSION) < 0) {
      $this->markTestSkipped();
    }

    $this->copyCodebase();
    $this->executeCommand('COMPOSER_DISCARD_CHANGES=true composer install --no-dev --no-interaction');
    $this->assertErrorOutputContains('Generating autoload files');
    $this->installQuickStart('minimal');
    $this->formLogin($this->adminUsername, $this->adminPassword);
    $this->visit('/.well-known/change-password');
    $this->assertDrupalVisit();
    $url = $this->getMink()->getSession()->getCurrentUrl();
    $this->assertEquals('http://localhost:' . $this->getPortNumber() . '/user/1/edit', $url);
  }

}

class InstallTest extends BuildTestBase {

  public function testInstall() {
    $this->copyCodebase();
    $fs = new Filesystem();
    $fs->chmod($this->getWorkspaceDirectory() . '/sites/default', 0700, 0000);

    // Composer tells you stuff in error output.     $this->executeCommand('COMPOSER_DISCARD_CHANGES=true composer install --no-interaction');
    $this->assertErrorOutputContains('Generating autoload files');

    // We have to stand up the server first so we can know the port number to     // pass along to the install command.     $this->standUpServer();

    $php_finder = new PhpExecutableFinder();
    $install_command = [
      $php_finder->find(),
      './core/scripts/test-site.php',
      'install',
      '--base-url=http://localhost:' . $this->getPortNumber(),
      
Home | Imprint | This part of the site doesn't use cookies.