Problem/Motivation
The class docs for TaxonomyImageTest say:
> * Tests access checks of private image fields.
But this test coverage is already provided by FilePrivateTest in the file module and ImageFieldDisplayTest in the image module.
There's nothing special about taxonomy module in this case (or there shouldn't be!)
Steps to reproduce
Proposed resolution
Remove the test.
Remaining tasks
Check that ImageFieldDisplayTest covers everything in TaxonomyImageTest.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | core-3305410-6.patch | 4.08 KB | _shy |
| #3 | core-3305410-3.patch | 4.04 KB | _shy |
Comments
Comment #2
joachim commentedComment #3
_shyChecked
ImageFieldDisplayTestclass.Functions
testImageFieldFormattersPublic()andtestImageFieldFormattersPrivate()checks the access for the image field in general. Meanwhile,TaxonomyImageTestdid actually the same, but specially for the taxonomy image field.I suppose, it's make sense to remove
TaxonomyImageTestclass. Added patch, just in case =)Comment #4
_shyComment #5
longwaveDid some digging to find out why we have two tests.
TaxonomyImageTest was added in #1327224: Access denied to taxonomy term image where we also added
taxonomy_file_download_access()as part of a bug fix. Thentaxonomy_file_download_access()was refactored away again in #2078473: Use entity access API for checking access to private files to a more generic solution that covered all entity types, so I agree that this explicit test coverage for taxonomy can be removed.Comment #6
_shyPatch update due to issue with applying.
Comment #7
alexpottFunnily enough there's a case to use this as a test for something else - but that will require moving to javascript and re-focusing the test so I think removing is fine. See #3277238: Fix \Drupal\taxonomy\Entity\Term::getName() to conform to the interface
Comment #8
alexpottCommitted and pushed 0cf5ca15dc to 10.1.x and 0bd8f26502 to 10.0.x and b771071a47 to 9.5.x. Thanks!
As a test only change backported to 9.5.x