Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Clean up the testing environment before the next test.
- *
- * @return void
- */
- protected function tearDown()
- {
- if ($this->app) {
- foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
- call_user_func($callback);
- }
- $this->app->flush();
- $this->app = null;
- }
- $this->setUpHasRun = false;
- if (property_exists($this, 'serverVariables')) {
- $this->serverVariables = [];
- }
- if (property_exists($this, 'defaultHeaders')) {
- $this->defaultHeaders = [];
- }
- if (class_exists('Mockery')) {
- if ($container = Mockery::getContainer()) {
- $this->addToAssertionCount($container->mockery_getExpectationCount());
- }
- Mockery::close();
- }
- if (class_exists(Carbon::class)) {
- Carbon::setTestNow();
- }
- $this->afterApplicationCreatedCallbacks = [];
- $this->beforeApplicationDestroyedCallbacks = [];
- Artisan::forgetBootstrappers();
- }
Add Comment
Please, Sign In to add comment