Problem/Motivation

@longwave found a possible error at one of the tests from core/modules/node/tests/src/Kernel/Plugin/migrate/source/d7/NodeTest.php (see here)
The tests [0] and [5] are the same.

Steps to reproduce

Open the file.

Proposed resolution

TODO

Remaining tasks

- Figure out why the code is like this.
- Propose a solution
- Fix it
- Review
- Commit

Comments

andregp created an issue. See original summary.

quietone’s picture

Title: Figure out why the strange test at ...source\d7\NodeTest::providerSource » Remove dupliate test from source\d7\NodeTest::providerSource
Status: Active » Needs review
StatusFileSize
new1.06 KB

The test was introduced in [#293798915]. It does appear to be a duplicate of $test[0]. I don't think it was intended to test something else, it is just an oversight. The test is testing without a configuration key 'node_type', with it set to 'page' and with it set to 'article' and 'page'. That should be sufficient for testing the 'node_type' key.

I have removed $test[5] and moved that comment from that test to $test[0]

quietone’s picture

Title: Remove dupliate test from source\d7\NodeTest::providerSource » Remove duplicate test from source\d7\NodeTest::providerSource

Fix typo in title

longwave’s picture

Removing this fixes a PHPStan error, so we have to remove that from the baseline as well.

andregp’s picture

Status: Needs work » Needs review
StatusFileSize
new6.03 KB
new4.89 KB

Removed the PHPStan ignore line related to this.

longwave’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
ankithashetty’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new6.02 KB
new1020 bytes

Uploading a rerolled patch, thanks!

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks. I agree with @quietone's assessment in #2 that this was an oversight in the original patch and the extra test case is unnecessary.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 3285667-7.patch, failed testing. View results

spokje’s picture

Status: Needs work » Reviewed & tested by the community

Random JS Test failure, started retest to be sure and back to RTBC.

  • catch committed 4fd25f4 on 10.1.x
    Issue #3285667 by andregp, ankithashetty, quietone, longwave: Remove...

  • catch committed 462932d on 10.0.x
    Issue #3285667 by andregp, ankithashetty, quietone, longwave: Remove...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!

Doesn't cherry-pick to 9.5.x due to phpstan baseline, but I think that's fine.

Status: Fixed » Closed (fixed)

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