Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Discovered in #3063887: Support PHPUnit 8 in Drupal 9, drop support for PHPUnit 7.
Drupal\migrate_drupal\Tests\StubTestTrait
implements
protected function createStub($entity_type_id)
This method has a name collision with a PHPUnit 8 method on PHPUnit\Framework\TestCase
that has a different signature and a different purpose.
This will prevent future usage of PHPUnit 8.
Proposed resolution
- Rename
createStub
to something else DeprecatecreateStub
- Add/adjust tests
Remaining tasks
API changes
\Drupal\migrate_drupal\Tests\StubTestTrait::createStub
is now \Drupal\migrate_drupal\Tests\StubTestTrait:: createEntityStub
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff_5-8.txt | 1.13 KB | mondrake |
#8 | 3097822-8.patch | 1.74 KB | mondrake |
Comments
Comment #2
mondrakeComment #3
mondrakeComment #4
mondrakeComment #5
mondrakeThere's apparently only one call of ::createStub outside of the trait itself in core's test codebase.
Comment #7
LendudeThese should point to a CR not this issue.
It feels a little excessive to do this deprecation for what is essentially an internal method for the trait. Not even migrate_tools and migrate_plus are using this, wouldn't just a CR suffice here?
Comment #8
mondrakeI like #7.
Comment #9
LendudeLet's see if others agree.
Added CR, updated IS to match this direction.
CR : https://www.drupal.org/node/3105980
Comment #10
catchI don't see a way around the internal API change, but also good that in practice no-one will notice so seems fine to go ahead here.
Comment #11
alexpottCommitted and pushed a5876a27ac to 9.0.x and 32e999c49b to 8.9.x. Thanks!
Okay so let's commit this to 8.9.x - so just incase someone is relying on this we'll only break in a major version.
Comment #14
alexpottI've published the change record - I don't think we add to the release notes unless we discover that unexpectedly this is used a lot.