Disable account registering from disabled email provider

This commit is contained in:
Peter Papp
2021-07-23 13:28:40 +02:00
parent 8951ebc69f
commit eaec744356
30 changed files with 733 additions and 71 deletions
+41
View File
@@ -60,6 +60,47 @@ class SignFlowTest extends TestCase
Notification::assertTimesSent(1, VerifyEmail::class);
}
/**
* @test
*/
public function it_try_register_when_registration_is_disabled()
{
Setting::create([
'name' => 'registration',
'value' => 0,
]);
$this->postJson('api/register', [
'email' => 'john@doe.com',
'password' => 'SecretPassword',
'password_confirmation' => 'SecretPassword',
'name' => 'John Doe',
])->assertStatus(401);
$this->assertDatabaseMissing('users', [
'email' => 'john@doe.com',
'email_verified_at' => null,
]);
}
/**
* @test
*/
public function it_try_register_from_disabled_email_provider()
{
$this->postJson('api/register', [
'email' => 'john@maildrop.cc',
'password' => 'SecretPassword',
'password_confirmation' => 'SecretPassword',
'name' => 'John Doe',
])->assertStatus(422);
$this->assertDatabaseMissing('users', [
'email' => 'john@doe.com',
'email_verified_at' => null,
]);
}
/**
* @test
*/
+1 -1
View File
@@ -117,7 +117,7 @@ class SettingsTest extends TestCase
]);
Storage::assertExists(
get_setting('app_logo')
get_settings('app_logo')
);
}
+1 -1
View File
@@ -194,7 +194,7 @@ class SetupWizardTest extends TestCase
collect(['app_logo', 'app_logo_horizontal', 'app_favicon'])
->each(function ($file) {
$path = get_setting($file);
$path = get_settings($file);
$this->assertNotNull($path);