Problem/Motivation
While working on #3318625: Remove active composer fixture files in UpdaterFormTest @kunal.sachdev
1) Drupal\Tests\automatic_updates_extensions\Functional\UpdaterFormTest::testSuccessfulUpdate with data set "maintenance mode on, semver module" (true, 'semver_test', 'Semver Test', '8.1.0', '8.1.1')
Exception: Warning: Undefined array key "type"
Drupal\package_manager\ComposerUtility->getProjectForPackage()() (Line: 240)
This was because it was trying to read the `drupal/core` package from the files in package_manager/tests/fixtures/fake_site/vendor/composer
These do not have a type property.
Steps to reproduce
Proposed resolution
Ensure the packages in package_manager/tests/fixtures/fake_site/vendor/composer are valid.
Maybe by adding a test here \Drupal\Tests\package_manager\Kernel\FakeSiteFixtureTest
To basically call \Drupal\package_manager\ComposerUtility::getProjectForPackage and \Drupal\package_manager\ComposerUtility::getPackageForProject
we can use name we know will return null because there are no packages that can be returned. but we should assert it returns null.
I think now it would have an exception because of the problem above.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork automatic_updates-3320487
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wim leersComment #3
tedbowComment #6
kunal.sachdev commentedComment #7
kunal.sachdev commentedThe test failure proves that the packages are not valid in
package_manager/tests/fixtures/fake_site/vendor/composer.Comment #8
kunal.sachdev commentedComment #9
tedbow@kunal.sachdev thanks for this issue!
I made a few small changes and added a comment about we need this new test method.
RTBC! Will merge if green.
Comment #11
tedbow