Skip to content

Commit

Permalink
[5.x] fix route caching CI error (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbutcher authored Jan 17, 2024
1 parent 5fca3f2 commit 21673cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
17 changes: 5 additions & 12 deletions tests/Feature/RouteCachingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace JoelButcher\Socialstream\Tests\Feature;

use App\Providers\RouteServiceProvider;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Socialite\Facades\Socialite;
use Laravel\Socialite\Two\GithubProvider;
Expand All @@ -14,20 +15,16 @@

uses(RefreshDatabase::class);

it('caches routes and redirects to provider', function () {
$this->defineCacheRoutes(file_get_contents(
__DIR__.'/../../workbench/routes/web.php'
));
beforeEach(function () {
$this->app->make(Kernel::class)->call('route:clear');
});

it('caches routes and redirects to provider', function () {
get('/oauth/github')
->assertRedirect();
});

it('caches routes and authenticates via GET', function () {
$this->defineCacheRoutes(file_get_contents(
__DIR__.'/../../workbench/routes/web.php'
));

$user = (new SocialiteUser())
->map([
'id' => fake()->numerify('########'),
Expand All @@ -52,10 +49,6 @@
});

it('caches routes and authenticates via POST', function () {
$this->defineCacheRoutes(file_get_contents(
__DIR__.'/../../workbench/routes/web.php'
));

$user = (new SocialiteUser())
->map([
'id' => fake()->numerify('########'),
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/SocialstreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use JoelButcher\Socialstream\Contracts\GeneratesProviderRedirect;
use JoelButcher\Socialstream\Features;
use JoelButcher\Socialstream\Socialstream;
use Laravel\Socialite\Facades\Socialite;
use Laravel\Socialite\Two\GithubProvider;
Expand Down

0 comments on commit 21673cc

Please sign in to comment.