123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Illuminate\Tests\Integration\Database;
- use Illuminate\Foundation\Testing\DatabaseMigrations;
- use Orchestra\Testbench\TestCase;
- abstract class DatabaseTestCase extends TestCase
- {
- use DatabaseMigrations;
- /**
- * The current database driver.
- *
- * @return string
- */
- protected $driver;
- protected function setUp(): void
- {
- $this->beforeApplicationDestroyed(function () {
- foreach (array_keys($this->app['db']->getConnections()) as $name) {
- $this->app['db']->purge($name);
- }
- });
- parent::setUp();
- }
- protected function getEnvironmentSetUp($app)
- {
- $connection = $app['config']->get('database.default');
- $this->driver = $app['config']->get("database.connections.$connection.driver");
- }
- }
|