Skip to content

Commit

Permalink
Complete exception handler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubka committed Oct 27, 2024
1 parent 15ee7d2 commit 6045f5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 12 additions & 8 deletions tests/Unit/Exceptions/HandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Exceptions\DbEncryptionException;
use App\Exceptions\EncryptedMigrationException;
use App\Exceptions\FailedIconStoreDatabaseTogglingException;
use App\Exceptions\Handler;
use App\Exceptions\InvalidMigrationDataException;
use App\Exceptions\InvalidOtpParameterException;
Expand Down Expand Up @@ -54,19 +55,25 @@ public static function provideExceptionsforBadRequest() : array
{
return [
[
InvalidOtpParameterException::class,
DbEncryptionException::class,
],
[
InvalidQrCodeException::class,
EncryptedMigrationException::class,
],
[
InvalidSecretException::class,
FailedIconStoreDatabaseTogglingException::class,
],
[
DbEncryptionException::class,
InvalidMigrationDataException::class,
],
[
InvalidMigrationDataException::class,
InvalidOtpParameterException::class,
],
[
InvalidQrCodeException::class,
],
[
InvalidSecretException::class,
],
[
UndecipherableException::class,
Expand All @@ -77,9 +84,6 @@ public static function provideExceptionsforBadRequest() : array
[
UnsupportedOtpTypeException::class,
],
[
EncryptedMigrationException::class,
],
];
}

Expand Down
2 changes: 0 additions & 2 deletions tests/Unit/Listeners/CleanIconStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class CleanIconStorageTest extends TestCase
#[Test]
public function test_it_deletes_icon_file_using_the_iconstore()
{
// TODO : Reuse the following mock as a global read-only
// SettingService mock for all tests, or create a dedicated stub
$this->mock(SettingService::class, function (MockInterface $iconStore) {
foreach (config('2fauth.settings') as $setting => $value) {
$iconStore->shouldReceive('get')
Expand Down

0 comments on commit 6045f5c

Please sign in to comment.