Currently the unit test flysystem_s3/tests/src/Unit/AwsCacheAdapterTest.php fails after upgrading to Drupal 9 using version 2.0.0-rc1.
PHP Fatal error: Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/site/web/modules/contrib/flysystem_s3/tests/src/Unit/AwsCacheAdapterTest.php
Would we be able to transition to using PHPUnit\Framework\Testcase?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3254472-update-tests-to-work-with-drupal-9-10.patch | 8.66 KB | leon kessler |
Issue fork flysystem_s3-3254472
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:
- 3254472-update-tests-to
changes, plain diff MR !6
Comments
Comment #2
jnlarAttached patch.
Comment #3
jnlarComment #4
leon kessler commentedRan the patch through the test runner on the new 2.0.x-dev branch, there's another fail. Updating the issue summary to cover this one as well.
Comment #6
leon kessler commentedSeems to be different errors running through gitlab than as a patch. Uploading changes from the MR as a patch file to confirm.
Comment #7
leon kessler commentedOkay I'm hoping this will be enough to get the tests to pass, let's see...
Comment #8
leon kessler commentedPrevious patch didn't include the file rename
ModuleInstallUninstallWebTestcorrectly.Comment #9
leon kessler commentedWoohooo! I think this can be merged in. But the tests could really do with a cleanup, I'll probably open another issue for that.
A few notes:
'public' => TRUEon anything that calls$plugin->getExternalUrl, as otherwise it hits FlysystemUrlTrait::getExternalUrl(), which in turn uses the UrlGenerator service. Whilst this can be mocked, it means we're not really testing that much functionality from the flysystem_s3 module. I'm not exactly sure how the tests were originally passing without'public' => TRUEbeing set, but I feel like anything callinggetExternalUrl()on the S3 plugin probably should be public. And that probably we need separate tests for private and public config.NoDrupalnamespaces were about, but these were causing errors so I updated them toDrupal.Comment #10
leon kessler commentedMade a few small improvements in latest patch:
function test()totestGetExternalUrlfunction testIamAuththat had no assertions.Comment #12
leon kessler commented