Skip to content
14 changes: 14 additions & 0 deletions src/Illuminate/Foundation/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ protected function setUpTraits()
$this->setUpFaker();
}

foreach (array_reverse($uses) as $trait => $int) {
if (method_exists($trait, $method = 'setUp'.$trait)) {
$this->{$method}();
}

if (method_exists($trait, $method = 'created'.$trait)) {
$this->afterApplicationCreated([$this, $method]);
}

if (method_exists($trait, $method = 'destroying'.$trait)) {
$this->beforeApplicationDestroyed([$this, $method]);
}
}

return $uses;
}

Expand Down