forked from laravel/passport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8657e3
commit bedf02c
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Laravel\Passport\Tests\Feature\Console; | ||
|
||
use Illuminate\Contracts\Hashing\Hasher; | ||
use Illuminate\Support\Str; | ||
use Laravel\Passport\Client; | ||
use Laravel\Passport\Passport; | ||
use Laravel\Passport\Tests\Feature\PassportTestCase; | ||
|
||
class HashCommand extends PassportTestCase | ||
{ | ||
public function test_it_can_properly_has_client_secrets() | ||
{ | ||
$client = factory(Client::class)->create(['secret' => $secret = Str::random(40)]); | ||
$hasher = $this->app->make(Hasher::class); | ||
|
||
Passport::hashClientSecrets(); | ||
|
||
$this->artisan('passport:hash', ['--force' => true]); | ||
|
||
$this->assertTrue($hasher->check($secret, $client->refresh()->secret)); | ||
|
||
Passport::$hashesClientSecrets = false; | ||
} | ||
} |