BaseLaravelTest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Knuckles\Scribe\Tests;
  3. use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
  4. use Knuckles\Scribe\ScribeServiceProvider;
  5. use Orchestra\Testbench\TestCase;
  6. class BaseLaravelTest extends TestCase
  7. {
  8. use TestHelpers;
  9. use ArraySubsetAsserts;
  10. protected function getEnvironmentSetUp($app)
  11. {
  12. $app['config']->set('database.default', 'test');
  13. $app['config']->set('database.connections.test', [
  14. 'driver' => 'sqlite',
  15. 'database' => ':memory:',
  16. 'prefix' => '',
  17. ]);
  18. $app['config']->set('database.default', 'sqlite');
  19. $app['config']->set('database.connections.sqlite', [
  20. 'driver' => 'sqlite',
  21. 'database' => ':memory:',
  22. 'prefix' => '',
  23. ]);
  24. ScribeServiceProvider::$customTranslationLayerLoaded = false;
  25. }
  26. /**
  27. * @param \Illuminate\Foundation\Application $app
  28. *
  29. * @return array
  30. */
  31. protected function getPackageProviders($app)
  32. {
  33. $providers = [
  34. ScribeServiceProvider::class,
  35. ];
  36. return $providers;
  37. }
  38. protected function setConfig($configValues): void
  39. {
  40. foreach ($configValues as $key => $value) {
  41. config(["scribe.$key" => $value]);
  42. config(["scribe_new.$key" => $value]);
  43. }
  44. }
  45. }