BaseTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace iBrand\Upload\Test;
  3. use Illuminate\Foundation\Testing\DatabaseMigrations;
  4. use Orchestra\Testbench\TestCase;
  5. abstract class BaseTest extends TestCase
  6. {
  7. use DatabaseMigrations;
  8. /**
  9. * set up test.
  10. */
  11. protected function setUp()
  12. {
  13. parent::setUp();
  14. $this->loadMigrationsFrom(__DIR__ . '../migrations');
  15. }
  16. /**
  17. * @param \Illuminate\Foundation\Application $app
  18. */
  19. protected function getEnvironmentSetUp($app)
  20. {
  21. $app['config']->set('database.default', 'testing');
  22. $app['config']->set('database.connections.testing', [
  23. 'driver' => 'sqlite',
  24. 'database' => ':memory:',
  25. ]);
  26. $app['config']->set('ibrand.uploader', require __DIR__ . '/../config/config.php');
  27. $app['config']->set('filesystems.disks', array_merge($app['config']->get('ibrand.uploader.disks'), $app['config']->get('filesystems.disks')));
  28. }
  29. /**
  30. * @param \Illuminate\Foundation\Application $app
  31. *
  32. * @return array
  33. */
  34. protected function getPackageProviders($app)
  35. {
  36. return [
  37. \Orchestra\Database\ConsoleServiceProvider::class,
  38. \iBrand\Upload\UploadServiceProvider::class,
  39. \Overtrue\LaravelFilesystem\Qiniu\QiniuStorageServiceProvider::class
  40. ];
  41. }
  42. }