@@ 27-36 (lines=10) @@ | ||
24 | $this->assertNull($model->create()); |
|
25 | } |
|
26 | ||
27 | public function testCreateUserWithAlreadyExistEmail() |
|
28 | { |
|
29 | $model = new UserModel(['scenario' => 'create']); |
|
30 | $model->email = '[email protected]'; |
|
31 | $model->plainPassword = 'password'; |
|
32 | $model->username = 'demo'; |
|
33 | ||
34 | $this->assertNull($model->create()); |
|
35 | $this->assertArrayHasKey('email', $model->errors); |
|
36 | } |
|
37 | ||
38 | public function testCorrectCreateUser() |
|
39 | { |
|
@@ 38-48 (lines=11) @@ | ||
35 | $this->assertArrayHasKey('email', $model->errors); |
|
36 | } |
|
37 | ||
38 | public function testCorrectCreateUser() |
|
39 | { |
|
40 | $model = new UserModel(['scenario' => 'create']); |
|
41 | $model->email = '[email protected]'; |
|
42 | $model->plainPassword = 'password'; |
|
43 | $model->username = 'new-user'; |
|
44 | ||
45 | $this->assertTrue($model->validate()); |
|
46 | $this->assertEmpty($model->errors); |
|
47 | $this->assertInstanceOf(UserModel::class, $model->create()); |
|
48 | } |
|
49 | ||
50 | public function testCreateUserEvents() |
|
51 | { |