- Issue created by @mondrake
- Assigned to spokje
- 🇳🇱Netherlands spokje
At first glance, this might become a META where we deprecate methods one by one, since especially
$this->randomMachineName()
is used a _lot_, but let's see where we end up if we go all in. - 🇮🇹Italy mondrake 🇮🇹
To be honest, I'm not even sure this is worth doing. Having a trait in the base classes and calling the methods non-statically allows avoiding the
use
import. - 🇳🇱Netherlands spokje
Hmm, that makes sense, we're looking at ~2500 lines of changed code here.
Maybe we do a nice "Closed (won't fix)" and move on to bigger (or rather smaller in code lines) and better things?
- 🇮🇹Italy mondrake 🇮🇹
Maybe we could limit to deprecating the use of the magic
__get
s introduced by the parent (i.e. stop allowing accessing the property directly) and maybeRandomGeneratorTrait::randomStringValidate()
which is just a callback that is no longer called since the entire implementation moved to the new static methods. - 🇬🇧United Kingdom catch
The
__get
was the one from the original issue that I thought we might not want to keep around forever.$this->randomMachineName() seems like it might be more trouble than it's worth to get rid of.
- 🇳🇱Netherlands spokje
There are also
\Drupal\Tests\UnitTestCase::randomMachineName
and\Drupal\Tests\UnitTestCase::getRandomGenerator
that are now basically copies of the methods in the Trait.Do we want/need to do anything with those?
- 🇮🇹Italy mondrake 🇮🇹
Maybe in UnitTestCase we could use the trait and remove the direct implementations?
- 🇳🇱Netherlands spokje
Opened 🐛 Fix incorrect usage of randomStringValidate in \Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::setUp Fixed about some weird/incorrect usage of
RandomGeneratorTrait::randomStringValidate()
- Issue was unassigned.
- 🇳🇱Netherlands spokje
Turned this issue into a META to prevent child-issues from delaying up each other from being committed.