Open agoalofalife opened 6 years ago
It would be convenient to do so..
You just override setupTraits
and get the return value from this method and do your own magic. That is the reason the array is actually returned.
Example (from my apps Testcase
):
protected function setUpTraits(): array
{
$uses = parent::setUpTraits();
if (isset($uses[ElasticSearchTrait::class])) {
$this->elasticsearchSetUp();
}
…
Or did I misunderstand you?
Method
setUpTraits
return uses array. https://github.com/laravel/framework/blob/805f67b1f36c1aa747138c81067cb6d56ef21ed5/src/Illuminate/Foundation/Testing/TestCase.php#L71I want to create a (custom)trait for the extension. It would be convenient to do so..
In the current version you need to override the method
setUp
or to violate the principleDRY
@taylorotwell What do you think about this?