@@ -39,6 +39,24 @@ public function testEmailRestrictions()
3939 $ this ->container ['memoryCache ' ]->flush ();
4040 $ this ->assertTrue ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@mydomain.tld ' )));
4141 $ this ->assertFalse ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@my-other-domain.tld ' )));
42+ $ this ->assertFalse ($ provider ->isAccountCreationAllowed (array ('email ' => 'test+mydomain.tld+@example.org ' )));
43+
44+ $ this ->assertTrue ($ this ->container ['configModel ' ]->save (array ('google_account_creation ' => '1 ' , 'google_email_domains ' => 'example.org, example.com ' )));
45+ $ this ->container ['memoryCache ' ]->flush ();
46+ $ this ->assertTrue ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@example.org ' )));
47+ $ this ->assertTrue ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@example.com ' )));
48+ $ this ->assertFalse ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@example.net ' )));
49+ $ this ->assertFalse ($ provider ->isAccountCreationAllowed (array ('email ' => 'invalid email ' )));
50+
51+ $ this ->assertTrue ($ this ->container ['configModel ' ]->save (array ('google_account_creation ' => '1 ' , 'google_email_domains ' => 'example ' )));
52+ $ this ->container ['memoryCache ' ]->flush ();
53+ $ this ->assertTrue ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@example ' )));
54+ $ this ->assertFalse ($ provider ->isAccountCreationAllowed (array ('email ' => 'example@localhost ' )));
55+
56+ $ this ->assertTrue ($ this ->container ['configModel ' ]->save (array ('google_account_creation ' => '1 ' , 'google_email_domains ' => 'example.org ' )));
57+ $ this ->container ['memoryCache ' ]->flush ();
58+ $ this ->assertTrue ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@example.org ' )));
59+ $ this ->assertFalse ($ provider ->isAccountCreationAllowed (array ('email ' => 'me@subdomain.example.org ' )));
4260 }
4361
4462 public function testGetClientId ()
0 commit comments