Unverified Commit 82c63a2a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3192900 by quietone, Matroskeen: Combine some migration kernel tests

parent f7dd26aa
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -123,12 +123,8 @@ public function testMigration() {
    $node = $comment->getCommentedEntity();
    $this->assertInstanceOf(NodeInterface::class, $node);
    $this->assertSame('1', $node->id());
  }

  /**
   * Tests the migration of comment entity translations.
   */
  public function testCommentEntityTranslations() {
    // Tests the migration of comment entity translations.
    $manager = $this->container->get('content_translation.manager');

    // Get the comment and its translations.
+1 −5
Original line number Diff line number Diff line
@@ -59,12 +59,8 @@ public function testUserMail() {
    $config = \Drupal::service('language_manager')->getLanguageConfigOverride('zu', 'user.mail');
    $this->assertSame('zu - An administrator created an account for you at [site:name]', $config->get('register_admin_created.subject'));
    $this->assertSame("zu - [user:name],\r\n\r\nA site administrator at [site:name] has created an account for you. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n--  [site:name] team", $config->get('register_admin_created.body'));
  }

  /**
   * Tests migration of i18n user variables to user.settings.yml.
   */
  public function testUserSettings() {
    // Tests migration of i18n user variables to user.settings.yml.
    $config = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'user.settings');
    $this->assertSame(1, $config->get('notify.status_blocked'));
    $this->assertSame(0, $config->get('notify.status_activated'));
+1 −6
Original line number Diff line number Diff line
@@ -51,13 +51,8 @@ public function testLanguageContent() {
    $this->assertTrue($config->isDefaultConfiguration());
    $this->assertFalse($config->isLanguageAlterable());
    $this->assertSame($config->getDefaultLangcode(), 'site_default');
  }

  /**
   * Tests migration of content language settings when there is no language lock.
   */
  public function testLanguageContentWithNoLanguageLock() {
    // Assert that a we can assign a language.
    // Assert that a we can assign a language when there is no language lock.
    $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'employee');
    $this->assertSame($config->getDefaultLangcode(), 'current_interface');
    $this->assertTrue($config->isLanguageAlterable());
+1 −6
Original line number Diff line number Diff line
@@ -250,12 +250,7 @@ public function testNode() {
    $node = $node->getTranslation('is');
    $this->assertSame($value, $node->field_text_plain->value);

  }

  /**
   * Test node entity translations migration from Drupal 7 to 8.
   */
  public function testNodeEntityTranslations() {
    // Test node entity translations migration from Drupal 7 to 8.
    $manager = $this->container->get('content_translation.manager');

    // Get the node and its translations.
+1 −6
Original line number Diff line number Diff line
@@ -122,14 +122,9 @@ public function testUrlAlias() {
      'langcode' => 'und',
    ];
    $this->assertPath(8, $conditions, $path_alias);
  }

  /**
   * Test the URL alias migration with translated nodes.
   */
  public function testUrlAliasWithTranslatedNodes() {
    // Test the URL alias migration with translated nodes.
    // Alias for the 'The Real McCoy' node in English.

    $path_alias = $this->loadPathAliasByConditions(['alias' => '/the-real-mccoy']);
    $this->assertSame('/node/10', $path_alias->getPath());
    $this->assertSame('en', $path_alias->get('langcode')->value);
Loading