Skip to content

Commit

Permalink
fix: facade accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
beliven-fabrizio-gortani committed Dec 21, 2024
1 parent d9e09f3 commit 50ce6c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Facades/PasswordHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ class PasswordHistory extends Facade
{
protected static function getFacadeAccessor(): string
{
return 'laravel-password-history';
return \Beliven\PasswordHistory\PasswordHistory::class;
}
}
10 changes: 10 additions & 0 deletions tests/PasswordHistoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Beliven\PasswordHistory\Entities\Enums\DomainErrorsEnum;
use Beliven\PasswordHistory\Exceptions\PasswordAlreadyHashedException;
use Beliven\PasswordHistory\Exceptions\PasswordInHistoryException;
use Beliven\PasswordHistory\Facades\PasswordHistory as PasswordHistoryFacade;
use Beliven\PasswordHistory\Models\PasswordHash;
use Beliven\PasswordHistory\PasswordHistory;
use Beliven\PasswordHistory\Rules\HasPasswordInHistory;
Expand All @@ -16,6 +17,15 @@
Config::set('password-history.depth', 5);
});

describe('Password history facade', function () {
it('should use the facade', function () {
$model = TestModel::create();
$result = PasswordHistoryFacade::hasPasswordInHistory($model, 'password');

expect($result)->toBeFalse();
});
});

describe('Password history methods', function () {
it('should not found password not yet used', function () {
$model = TestModel::create();
Expand Down

0 comments on commit 50ce6c1

Please sign in to comment.