Problem/Motivation
As discovered in #2976035: Entity type CRUD operations must use the last installed entity type and field storage definitions , \Drupal\Tests\media\Functional\Update\MediaUpdateTest
does a few things wrongly:
drupal-8.media-enabled.php
installs live config definitions from the standard profile. That's a big no-no for upgrade path tests since the "installed site fixture" is a moving target, which makes test results completely unpredictableMediaUpdateTest::testOEmbedConfig()
tries to bypass the problem described above by removing data from a config file before running the updates. That data should not have been there in the first placeMediaUpdateTest::testBundlePermission()
changes arole
config entity via API calls before running the updates, which is not allowed/supported
Proposed resolution
- replace drupal-8.media-enabled.php
with a database fixture which installs only the objects created by the Media module in Drupal 8.4.0
- add additional permissions to the authenticated
role in an update fixture file instead of using API calls before running the updates
- don't change the media.settings
config file before running the updates, because the database dump from above includes the correct file and data for it
Remaining tasks
Review.
User interface changes
Nope.
API changes
Nope.
Data model changes
Nope.