|
@@ 57-68 (lines=12) @@
|
| 54 |
|
$this->assertFalse($result); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
public function test_is_unique_username_pass() { |
| 58 |
|
//username is unique, return true |
| 59 |
|
|
| 60 |
|
$validation = $this->getDouble( |
| 61 |
|
'MY_Form_validation', |
| 62 |
|
['is_unique' => TRUE] |
| 63 |
|
); |
| 64 |
|
$this->verifyInvokedOnce($validation, 'is_unique'); |
| 65 |
|
|
| 66 |
|
$result = $validation->is_unique_username('FooBar'); |
| 67 |
|
$this->assertTrue($result); |
| 68 |
|
} |
| 69 |
|
public function test_is_unique_username_fail() { |
| 70 |
|
//username already exists, return false |
| 71 |
|
|
|
@@ 83-94 (lines=12) @@
|
| 80 |
|
$this->assertFalse($result); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
public function test_is_unique_email_pass() { |
| 84 |
|
//email is unique, return true |
| 85 |
|
|
| 86 |
|
$validation = $this->getDouble( |
| 87 |
|
'MY_Form_validation', |
| 88 |
|
['is_unique' => TRUE] |
| 89 |
|
); |
| 90 |
|
$this->verifyInvokedOnce($validation, 'is_unique'); |
| 91 |
|
|
| 92 |
|
$result = $validation->is_unique_email('[email protected]'); |
| 93 |
|
$this->assertTrue($result); |
| 94 |
|
} |
| 95 |
|
public function test_is_unique_email_fail() { |
| 96 |
|
//email already exists, return false |
| 97 |
|
|