Problem/Motivation

Languages's Migrate source test extend the (deprecated) class MigrateSqlSourceTestCase.

Proposed resolution

Change the test to extend the base class MigrateSqlSourceTestBase introduced in #2791119: Write meaningful Migrate source tests.

Remaining tasks

Rewrite test.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jo Fitzgerald created an issue. See original summary.

jofitz’s picture

Assigned: jofitz » Unassigned
Issue summary: View changes
Status: Active » Needs review
Parent issue: » #2807767: [META] Convert Migrate source plugin tests to new base class
FileSize
4.37 KB

Rewrote test.

quietone’s picture

Status: Needs review » Needs work

@Jo Fitzgerald, thanks for finding this one.

+++ b/core/modules/language/tests/src/Kernel/Migrate/LanguageTest.php
@@ -0,0 +1,89 @@
+namespace Drupal\Tests\language\Kernel\Migrate;

Should be Drupal\Tests\language\Kernel\Plugin\migrate\source. Compare with UserTest.php

jofitz’s picture

@quietone Is the location of the file important too? Currently it is core/modules/language/tests/src/Kernel/Migrate/LanguageTest.php should it be core/modules/language/tests/src/Kernel/Plugin/migrate/source/LanguageTest.php?

jofitz’s picture

Status: Needs work » Needs review
FileSize
4.39 KB
513 bytes

I have adjusted the namespace, but not moved the file. Shout if that needs to change.

Status: Needs review » Needs work

The last submitted patch, 5: 2848364-5.patch, failed testing.

jofitz’s picture

Status: Needs work » Needs review
FileSize
4.43 KB
343 bytes
quietone’s picture

Status: Needs review » Needs work
  1. --- /dev/null
    +++ b/core/modules/language/tests/src/Kernel/Plugin/migrate/source/LanguageTest.php
    

    Yes, this is right.

  2. +++ b/core/modules/language/tests/src/Kernel/Plugin/migrate/source/LanguageTest.php
    @@ -0,0 +1,89 @@
    +      'language' => 'fr',
    +      'name' => 'French',
    +      'native' => 'Français',
    +      'direction' => '0',
    +      'enabled' => '0',
    +      'plurals' => '2',
    +      'formula' => '($n>1)',
    +      'domain' => '',
    +      'prefix' => 'fr',
    +      'weight' => '0',
    +      'javascript' => '',
    

    Indentation needs fixing. Then it'll be good to go.

jofitz’s picture

Status: Needs work » Needs review
FileSize
4.45 KB
1.07 KB

Dunno how I missed that! Let's get this done.

quietone’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

xjm’s picture

Version: 8.4.x-dev » 8.3.x-dev

As an improvement to a single test for an experimental module, this change is eligible for 8.3.x in any alpha, beta, or patch release. Thanks!

  • xjm committed 0ce4401 on 8.4.x
    Issue #2848364 by Jo Fitzgerald, quietone: Convert Languages's Migrate...

  • xjm committed c4fc21e on 8.3.x
    Issue #2848364 by Jo Fitzgerald, quietone: Convert Languages's Migrate...
xjm’s picture

The broken patch in #5 kind of proves the test is running, so that's cool in a way. :)

Committed to 8.4.x and 8.3.x. Thanks!

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.