SmsTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /*
  3. * This file is part of ibrand/laravel-sms.
  4. *
  5. * (c) iBrand <https://www.ibrand.cc>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace iBrand\Sms\Test;
  11. class SmsTest extends \Orchestra\Testbench\TestCase
  12. {
  13. use SmsTestTrait;
  14. /**
  15. * @param \Illuminate\Foundation\Application $app
  16. *
  17. * @return array
  18. */
  19. protected function getPackageProviders($app)
  20. {
  21. return ['iBrand\Sms\ServiceProvider'];
  22. }
  23. /**
  24. * @param \Illuminate\Foundation\Application $app
  25. *
  26. * @return array
  27. */
  28. protected function getPackageAliases($app)
  29. {
  30. return [
  31. 'Sms' => "iBrand\Sms\Facade",
  32. ];
  33. }
  34. protected function getEnvironmentSetUp($app)
  35. {
  36. $app['config']->set('ibrand.sms', require __DIR__.'/../config/config.php');
  37. $app['config']->set('database.default', 'testbench');
  38. $app['config']->set('database.connections.testbench', [
  39. 'driver' => 'sqlite',
  40. 'database' => ':memory:',
  41. 'prefix' => '',
  42. ]);
  43. }
  44. protected function loadMigrationsFrom($app)
  45. {
  46. $this->artisan('migrate', ['--database' => 'testbench']);
  47. }
  48. protected function setUp()
  49. {
  50. parent::setUp(); // TODO: Change the autogenerated stub
  51. $this->loadMigrationsFrom(__DIR__.'/database');
  52. }
  53. }