TestCase.php 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // Copyright 2019 Hackware SpA <human@hackware.cl>
  3. // "Hackware Web Services Core" is released under the MIT License terms.
  4. namespace Hawese\Tests;
  5. // use PHPUnit\Framework\TestCase as BaseTestCase; // Eventually
  6. use Laravel\Lumen\Testing\TestCase as BaseTestCase;
  7. abstract class TestCase extends BaseTestCase
  8. {
  9. public function createApplication()
  10. {
  11. return require 'bootstrap/app.php';
  12. }
  13. /**
  14. * Access to database schema builder without Schema facade
  15. */
  16. protected static function schema()
  17. {
  18. return app('db')->connection()->getSchemaBuilder();
  19. }
  20. /**
  21. * I don't want it fluent.
  22. */
  23. public function request(
  24. $method,
  25. $uri,
  26. array $data = [],
  27. array $headers = []
  28. ) {
  29. $this->json($method, $uri, $data, $headers);
  30. return $this->response;
  31. }
  32. protected function validOrigin()
  33. {
  34. return preg_split('/, ?/', env('CORS_ALLOW_ORIGINS'))[0];
  35. }
  36. }