[TESTS][Security] Fix SecurityTest. Remove nickname normalization on register (a plugin can handle that). Move from filter_var(FILTER_VALIDATE_EMAIL) as it does not support dotless domains
This commit is contained in:
@@ -66,9 +66,8 @@ class SecurityTest extends GNUsocialTestCase
|
||||
{
|
||||
self::testLogin('taken_user', 'wrong password');
|
||||
$this->assertResponseIsSuccessful();
|
||||
// TODO(eliseu) Login page doesn't have this error
|
||||
// $this->assertSelectorTextContains('.alert', 'Invalid login credentials');
|
||||
$this->assertRouteSame('login');
|
||||
$this->assertSelectorTextContains('.alert', 'Invalid login credentials');
|
||||
$this->assertRouteSame('security_login');
|
||||
}
|
||||
|
||||
public function testLoginEmail()
|
||||
@@ -120,7 +119,7 @@ class SecurityTest extends GNUsocialTestCase
|
||||
]);
|
||||
$this->assertSelectorTextContains('form[name=register] ul li', 'The password fields must match');
|
||||
$this->assertResponseStatusCodeSame(200);
|
||||
$this->assertRouteSame('register');
|
||||
$this->assertRouteSame('security_register');
|
||||
}
|
||||
|
||||
private function testRegisterPasswordLength(string $password, string $error)
|
||||
@@ -128,7 +127,7 @@ class SecurityTest extends GNUsocialTestCase
|
||||
self::testRegister('new_nickname', 'email@provider', $password);
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertSelectorTextContains('.help-block > ul > li', $error);
|
||||
$this->assertRouteSame('register');
|
||||
$this->assertRouteSame('security_register');
|
||||
}
|
||||
|
||||
public function testRegisterPasswordEmpty()
|
||||
@@ -151,7 +150,7 @@ class SecurityTest extends GNUsocialTestCase
|
||||
self::testRegister('new_nickname', '', 'foobar');
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertSelectorTextContains('.help-block > ul > li', 'Please enter an email');
|
||||
$this->assertRouteSame('register');
|
||||
$this->assertRouteSame('security_register');
|
||||
}
|
||||
|
||||
private function testRegisterNicknameLength(string $nickname, string $error)
|
||||
@@ -159,7 +158,7 @@ class SecurityTest extends GNUsocialTestCase
|
||||
self::testRegister($nickname, 'email@provider', 'foobar');
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertSelectorTextContains('.help-block > ul > li', $error);
|
||||
$this->assertRouteSame('register');
|
||||
$this->assertRouteSame('security_register');
|
||||
}
|
||||
|
||||
public function testRegisterNicknameEmpty()
|
||||
@@ -167,11 +166,6 @@ class SecurityTest extends GNUsocialTestCase
|
||||
self::testRegisterNicknameLength('', error: 'Please enter a nickname');
|
||||
}
|
||||
|
||||
public function testRegisterNicknameShort()
|
||||
{
|
||||
self::testRegisterNicknameLength('f', error: 'Your nickname must be at least');
|
||||
}
|
||||
|
||||
public function testRegisterNicknameLong()
|
||||
{
|
||||
self::testRegisterNicknameLength(str_repeat('f', 128), error: 'Your nickname must be at most');
|
||||
|
Reference in New Issue
Block a user