mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 03:38:06 +02:00
Fix pint issues
This commit is contained in:
parent
7e52dcd7da
commit
bc090e2d4d
@ -15,7 +15,7 @@ class CaseInsensitiveEmailExists implements ValidationRule
|
|||||||
public function validate(string $attribute, mixed $value, Closure $fail) : void
|
public function validate(string $attribute, mixed $value, Closure $fail) : void
|
||||||
{
|
{
|
||||||
$user = DB::table('users')
|
$user = DB::table('users')
|
||||||
->whereRaw('email = ?' . ('sqlite' === config('database.default') ? ' COLLATE NOCASE' : ''), [strtolower($value)])
|
->whereRaw('email = ?' . (config('database.default') === 'sqlite' ? ' COLLATE NOCASE' : ''), [strtolower($value)])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if (! $user) {
|
if (! $user) {
|
||||||
|
@ -77,7 +77,8 @@ class GoogleAuthMigrator extends Migrator
|
|||||||
/**
|
/**
|
||||||
* Encode into uppercase Base32
|
* Encode into uppercase Base32
|
||||||
*/
|
*/
|
||||||
protected function toBase32(string $str) {
|
protected function toBase32(string $str)
|
||||||
|
{
|
||||||
return Base32::encodeUpper($str);
|
return Base32::encodeUpper($str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,10 +45,10 @@ class PurgeLogTest extends FeatureTestCase
|
|||||||
$this->artisan('2fauth:purge-log');
|
$this->artisan('2fauth:purge-log');
|
||||||
|
|
||||||
$this->assertDatabaseHas('auth_logs', [
|
$this->assertDatabaseHas('auth_logs', [
|
||||||
'id' => $sixMonthsOldLog->id
|
'id' => $sixMonthsOldLog->id,
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseMissing('auth_logs', [
|
$this->assertDatabaseMissing('auth_logs', [
|
||||||
'id' => $oneYearOldLog->id
|
'id' => $oneYearOldLog->id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ class PurgeLogTest extends FeatureTestCase
|
|||||||
$this->artisan('2fauth:purge-log');
|
$this->artisan('2fauth:purge-log');
|
||||||
|
|
||||||
$this->assertDatabaseMissing('auth_logs', [
|
$this->assertDatabaseMissing('auth_logs', [
|
||||||
'id' => $log->id
|
'id' => $log->id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class PurgeLogTest extends FeatureTestCase
|
|||||||
$this->artisan('2fauth:purge-log');
|
$this->artisan('2fauth:purge-log');
|
||||||
|
|
||||||
$this->assertDatabaseMissing('auth_logs', [
|
$this->assertDatabaseMissing('auth_logs', [
|
||||||
'id' => $log->id
|
'id' => $log->id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ class PurgeLogTest extends FeatureTestCase
|
|||||||
$this->artisan('2fauth:purge-log');
|
$this->artisan('2fauth:purge-log');
|
||||||
|
|
||||||
$this->assertDatabaseHas('auth_logs', [
|
$this->assertDatabaseHas('auth_logs', [
|
||||||
'id' => $log->id
|
'id' => $log->id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,10 +114,10 @@ class PurgeLogTest extends FeatureTestCase
|
|||||||
$this->artisan('2fauth:purge-log');
|
$this->artisan('2fauth:purge-log');
|
||||||
|
|
||||||
$this->assertDatabaseHas('auth_logs', [
|
$this->assertDatabaseHas('auth_logs', [
|
||||||
'id' => $sixMonthsOldLog->id
|
'id' => $sixMonthsOldLog->id,
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseMissing('auth_logs', [
|
$this->assertDatabaseMissing('auth_logs', [
|
||||||
'id' => $oneYearOldLog->id
|
'id' => $oneYearOldLog->id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,15 +128,14 @@ class PurgeLogTest extends FeatureTestCase
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'NULL' => [
|
'NULL' => [
|
||||||
null
|
null,
|
||||||
],
|
],
|
||||||
'EMPTY' => [
|
'EMPTY' => [
|
||||||
''
|
'',
|
||||||
],
|
],
|
||||||
'STRING' => [
|
'STRING' => [
|
||||||
'ljhkjh'
|
'ljhkjh',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ use App\Services\Migrators\TwoFASMigrator;
|
|||||||
use App\Services\Migrators\TwoFAuthMigrator;
|
use App\Services\Migrators\TwoFAuthMigrator;
|
||||||
use App\Services\SettingService;
|
use App\Services\SettingService;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Mockery;
|
|
||||||
use Mockery\MockInterface;
|
use Mockery\MockInterface;
|
||||||
use PHPUnit\Framework\Attributes\CoversClass;
|
use PHPUnit\Framework\Attributes\CoversClass;
|
||||||
use PHPUnit\Framework\Attributes\DataProvider;
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
@ -141,7 +140,6 @@ class MigratorTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* Clean up the testing environment before the next test.
|
* Clean up the testing environment before the next test.
|
||||||
*
|
*
|
||||||
* @return void
|
|
||||||
*
|
*
|
||||||
* @throws \Mockery\Exception\InvalidCountException
|
* @throws \Mockery\Exception\InvalidCountException
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user