mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-16 10:29:16 +01:00
Complete exception handler tests
This commit is contained in:
parent
15ee7d2e24
commit
6045f5c975
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use App\Exceptions\DbEncryptionException;
|
use App\Exceptions\DbEncryptionException;
|
||||||
use App\Exceptions\EncryptedMigrationException;
|
use App\Exceptions\EncryptedMigrationException;
|
||||||
|
use App\Exceptions\FailedIconStoreDatabaseTogglingException;
|
||||||
use App\Exceptions\Handler;
|
use App\Exceptions\Handler;
|
||||||
use App\Exceptions\InvalidMigrationDataException;
|
use App\Exceptions\InvalidMigrationDataException;
|
||||||
use App\Exceptions\InvalidOtpParameterException;
|
use App\Exceptions\InvalidOtpParameterException;
|
||||||
@ -53,6 +54,18 @@ public function test_exceptions_returns_badRequest_json_response($exception)
|
|||||||
public static function provideExceptionsforBadRequest() : array
|
public static function provideExceptionsforBadRequest() : array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
[
|
||||||
|
DbEncryptionException::class,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
EncryptedMigrationException::class,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
FailedIconStoreDatabaseTogglingException::class,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
InvalidMigrationDataException::class,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
InvalidOtpParameterException::class,
|
InvalidOtpParameterException::class,
|
||||||
],
|
],
|
||||||
@ -62,12 +75,6 @@ public static function provideExceptionsforBadRequest() : array
|
|||||||
[
|
[
|
||||||
InvalidSecretException::class,
|
InvalidSecretException::class,
|
||||||
],
|
],
|
||||||
[
|
|
||||||
DbEncryptionException::class,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
InvalidMigrationDataException::class,
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
UndecipherableException::class,
|
UndecipherableException::class,
|
||||||
],
|
],
|
||||||
@ -77,9 +84,6 @@ public static function provideExceptionsforBadRequest() : array
|
|||||||
[
|
[
|
||||||
UnsupportedOtpTypeException::class,
|
UnsupportedOtpTypeException::class,
|
||||||
],
|
],
|
||||||
[
|
|
||||||
EncryptedMigrationException::class,
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@ class CleanIconStorageTest extends TestCase
|
|||||||
#[Test]
|
#[Test]
|
||||||
public function test_it_deletes_icon_file_using_the_iconstore()
|
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) {
|
$this->mock(SettingService::class, function (MockInterface $iconStore) {
|
||||||
foreach (config('2fauth.settings') as $setting => $value) {
|
foreach (config('2fauth.settings') as $setting => $value) {
|
||||||
$iconStore->shouldReceive('get')
|
$iconStore->shouldReceive('get')
|
||||||
|
Loading…
Reference in New Issue
Block a user