TestCase.php 872 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. }