- Status changed to Needs work
almost 2 years ago 9:56pm 29 January 2023
TaxonomyTestTrait has two methods that are directly related to generating entities. They are inconsistent from the perspective of "I want to create an entity, potentially with some values".
function createVocabulary() {
function createTerm(Vocabulary $vocabulary, $values = []) {
The question came up on
β¨
Allow raw vid to be sorted in views
Fixed
about whether I was breaking BC by adding a $values
to createVocabulary()
. At the moment it is true that someone in a project could extend TaxonomyTestTrait, they could override createVocabulary()
with createVocabulary($some_string);
and thus if I added $values
to the core method I might break their tests.
First, I want to suggest that ENTITYTestTraits should be marked @internal (see below). But if we want to improve re-usability of such traits, and avoid BC issues, we should define some standards right now. So i"m just throwing this out there to see what sticks...
Wait, what? They're just test helpers, and test classes/methods are not in scope for BC... (I'm assuming, but hey we don't actually *test* them.)
So maybe these traits should be marked as @internal
? Since they are explicitly only for testing - only for re-usability of code in testing - should they be excluded from the API? Let's say I subclassed a core test and started using it's methods, does that mean the core tests need to maintain their own internal method interfaces?
Needs work
11.0 π₯
Used to track the progress of issues reviewed by the Drupal Needs Review Queue Initiative.
It is used to alert the release manager core committer(s) that an issue significantly affects the overall technical debt or release timeline of Drupal, and their signoff is needed. See the governance policy draft for more information.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.