Guest User

Untitled

a guest
Feb 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /**
  2. * Clean up the testing environment before the next test.
  3. *
  4. * @return void
  5. */
  6. protected function tearDown()
  7. {
  8. if ($this->app) {
  9. foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
  10. call_user_func($callback);
  11. }
  12.  
  13. $this->app->flush();
  14.  
  15. $this->app = null;
  16. }
  17.  
  18. $this->setUpHasRun = false;
  19.  
  20. if (property_exists($this, 'serverVariables')) {
  21. $this->serverVariables = [];
  22. }
  23.  
  24. if (property_exists($this, 'defaultHeaders')) {
  25. $this->defaultHeaders = [];
  26. }
  27.  
  28. if (class_exists('Mockery')) {
  29. if ($container = Mockery::getContainer()) {
  30. $this->addToAssertionCount($container->mockery_getExpectationCount());
  31. }
  32.  
  33. Mockery::close();
  34. }
  35.  
  36. if (class_exists(Carbon::class)) {
  37. Carbon::setTestNow();
  38. }
  39.  
  40. $this->afterApplicationCreatedCallbacks = [];
  41. $this->beforeApplicationDestroyedCallbacks = [];
  42.  
  43. Artisan::forgetBootstrappers();
  44. }
Add Comment
Please, Sign In to add comment