mirror of
https://github.com/elyby/accounts.git
synced 2024-11-30 10:42:16 +05:30
Added change username form
This commit is contained in:
parent
75a0811488
commit
267822ba99
@ -36,6 +36,26 @@ class ChangeUsernameFormTest extends DbTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
public function testUsernameUnavailable() {
|
||||
$this->specify('error.username_not_available expected if username is already taken', function() {
|
||||
$model = new DummyChangeUsernameForm([
|
||||
'password' => 'password_0',
|
||||
'username' => 'Jon',
|
||||
]);
|
||||
$model->validate();
|
||||
expect($model->getErrors('username'))->equals(['error.username_not_available']);
|
||||
});
|
||||
|
||||
$this->specify('error.username_not_available is NOT expected if username is already taken by CURRENT user', function() {
|
||||
$model = new DummyChangeUsernameForm([
|
||||
'password' => 'password_0',
|
||||
'username' => 'Admin',
|
||||
]);
|
||||
$model->validate();
|
||||
expect($model->getErrors('username'))->equals([]);
|
||||
});
|
||||
}
|
||||
|
||||
public function testCreateTask() {
|
||||
$model = new DummyChangeUsernameForm();
|
||||
$model->createTask('1', 'test1', 'test');
|
||||
|
Loading…
Reference in New Issue
Block a user