Skip to content

Commit

Permalink
Laravel 8.x test support
Browse files Browse the repository at this point in the history
  • Loading branch information
roelofr committed Mar 7, 2023
1 parent 528de9e commit 4cfa228
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ class TestCase extends OrchestraTestCase
{
use DatabaseMigrations;

/**
* Ensure the HTTP Client requests have a method to prevent stray requests (without logic)
* @before
*/
protected function repairLaravel8Compatibiliy() {
if (! \Composer\InstalledVersions::satisfies(new \Composer\Semver\VersionParser, 'illuminate/support', '^8.0')) {
return;
}

$this->afterApplicationCreated(function () {
\Illuminate\Http\Client\PendingRequest::macro('preventStrayRequests', function () {
return $this;
});
});
}

/**
* Path to config file from here
*/
Expand Down

0 comments on commit 4cfa228

Please sign in to comment.