Skip to content

Commit

Permalink
Merge branch '8.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Feb 20, 2020
2 parents 746ffc3 + a35da95 commit d3874bd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ matrix:
allow_failures:
- env: LARAVEL=^7.0

services:
- mysql

before_install:
- phpenv config-rm xdebug.ini || true
- mysql -e 'CREATE DATABASE forge;'

install:
- travis_retry composer require "illuminate/contracts=${LARAVEL}" --dev --prefer-dist --no-interaction --no-suggest
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>

<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
</php>
Expand Down
19 changes: 4 additions & 15 deletions src/PassportServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function boot()
__DIR__.'/../database/factories' => database_path('factories'),
], 'passport-factories');

$this->publishes([
__DIR__.'/../config/passport.php' => config_path('passport.php'),
], 'passport-config');

$this->commands([
Console\InstallCommand::class,
Console\ClientCommand::class,
Expand Down Expand Up @@ -90,7 +94,6 @@ public function register()
$this->registerAuthorizationServer();
$this->registerResourceServer();
$this->registerGuard();
$this->offerPublishing();
}

/**
Expand Down Expand Up @@ -296,18 +299,4 @@ protected function deleteCookieOnLogout()
}
});
}

/**
* Setup the resource publishing groups for Passport.
*
* @return void
*/
protected function offerPublishing()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/passport.php' => config_path('passport.php'),
], 'passport-config');
}
}
}
2 changes: 1 addition & 1 deletion tests/Feature/AccessTokenControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function tearDown(): void
parent::tearDown();
}

protected function getUserClass(): ?string
protected function getUserClass()
{
return User::class;
}
Expand Down
22 changes: 9 additions & 13 deletions tests/Feature/PassportTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace Laravel\Passport\Tests\Feature;

use Illuminate\Contracts\Config\Repository;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Passport\Passport;
use Laravel\Passport\PassportServiceProvider;
use Orchestra\Testbench\TestCase;

abstract class PassportTestCase extends TestCase
{
use DatabaseTransactions;
use RefreshDatabase;

protected function setUp(): void
{
Expand All @@ -31,21 +31,18 @@ protected function getEnvironmentSetUp($app)

$config->set('auth.defaults.provider', 'users');

if (null !== ($userClass = $this->getUserClass())) {
if (($userClass = $this->getUserClass()) !== null) {
$config->set('auth.providers.users.model', $userClass);
}

$config->set('auth.guards.api', ['driver' => 'passport', 'provider' => 'users']);

$config->set('database.default', 'forge');
$app['config']->set('database.default', 'testbench');

$config->set('database.connections.forge', [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'username' => 'root',
'password' => '',
'database' => 'forge',
'prefix' => '',
$app['config']->set('database.connections.testbench', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
}

Expand All @@ -59,8 +56,7 @@ protected function getPackageProviders($app)
*
* @return string|null
*/
protected function getUserClass(): ?string
protected function getUserClass()
{
return null;
}
}

0 comments on commit d3874bd

Please sign in to comment.