Commit 6d4b0ae8 authored by catch's avatar catch
Browse files

Issue #2561229 by alexpott, dawehner: Upgrade content tests fails on postgres...

Issue #2561229 by alexpott, dawehner: Upgrade content tests fails on postgres for translated comment
parent 7210716a
Loading
Loading
Loading
Loading
+2 −2
Changes for core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -180,8 +180,8 @@ function checkBinaryOutput() {
   * Verify that a binary data roundtrip returns the original string.
   */
  protected function checkBinaryOutputSuccess() {
    $bytea_output = db_query("SELECT 'encoding'::bytea AS output")->fetchField();
    return ($bytea_output == 'encoding');
    $bytea_output = db_query("SHOW bytea_output")->fetchField();
    return ($bytea_output == 'escape');
  }

  /**
+31 −1
Changes for core/modules/system/src/Tests/Update/UpdatePathTestBase.php: 31 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -10,9 +10,12 @@
use Drupal\Component\Utility\Crypt;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\Core\Database\Database;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\Language\Language;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
use Drupal\user\Entity\User;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Request;

/**
@@ -141,7 +144,7 @@ function __construct($test_id = NULL) {
   * container that would normally be done via the installer.
   */
  protected function setUp() {

    $this->runDbTasks();
    // Allow classes to set database dump files.
    $this->setDatabaseDumpFiles();

@@ -260,6 +263,33 @@ protected function runUpdates() {
    $this->assertFalse(\Drupal::service('entity.definition_update_manager')->needsUpdates(), 'After all updates ran, entity schema is up to date.');
  }

  /**
   * Runs the install database tasks for the driver used by the test runner.
   */
  protected function runDbTasks() {
    // Create a minimal container so that t() works.
    // @see install_begin_request()
    $container = new ContainerBuilder();
    $container->setParameter('language.default_values', Language::$defaultValues);
    $container
      ->register('language.default', 'Drupal\Core\Language\LanguageDefault')
      ->addArgument('%language.default_values%');
    $container
      ->register('language_manager', 'Drupal\Core\Language\LanguageManager')
      ->addArgument(new Reference('language.default'));
    $container
      ->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager')
      ->addArgument(new Reference('language_manager'));
    \Drupal::setContainer($container);

    require_once __DIR__ . '/../../../../../includes/install.inc';
    $connection = Database::getConnection();
    $errors = db_installer_object($connection->driver())->runTasks();
    if (!empty($errors)) {
      $this->fail('Failed to run installer database tasks: ' . implode(', ', $errors));
    }
  }

  /**
   * Replace User 1 with the user created here.
   */
+1 −1
Changes for core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

/**
 * @file
 * Contains \Drupal\system\Tests\Update\UpdatePathTestBaseFilledTest.php
 * Contains \Drupal\system\Tests\Update\UpdatePathTestBaseFilledTest.
 */

namespace Drupal\system\Tests\Update;