|
5 | 5 | use CodeIgniter\Config\Factories; |
6 | 6 | use CodeIgniter\I18n\Time; |
7 | 7 | use CodeIgniter\Shield\Authentication\Actions\Email2FA; |
8 | | -use CodeIgniter\Shield\Config\Auth; |
9 | 8 | use CodeIgniter\Test\DatabaseTestTrait; |
10 | 9 | use CodeIgniter\Test\FeatureTestTrait; |
11 | 10 | use Config\Services; |
| 11 | +use Config\Validation; |
12 | 12 | use Tests\Support\FakeUser; |
13 | 13 | use Tests\Support\TestCase; |
14 | 14 |
|
@@ -112,12 +112,13 @@ public function testAfterLoggedInNotDesplayLoginPage(): void |
112 | 112 | public function testLoginActionUsernameSuccess(): void |
113 | 113 | { |
114 | 114 | // Change the validation rules |
115 | | - $config = new Auth(); |
116 | | - $config->loginRules = [ |
117 | | - 'username' => 'required|max_length[30]|alpha_numeric_space|min_length[3]', |
118 | | - 'password' => 'required', |
119 | | - ]; |
120 | | - Factories::injectMock('config', 'Auth', $config); |
| 115 | + $config = new class () extends Validation { |
| 116 | + public $login = [ |
| 117 | + 'username' => 'required|max_length[30]|alpha_numeric_space|min_length[3]', |
| 118 | + 'password' => 'required', |
| 119 | + ]; |
| 120 | + }; |
| 121 | + Factories::injectMock('config', 'Validation', $config); |
121 | 122 |
|
122 | 123 | $this->user->createEmailIdentity([ |
123 | 124 | 'email' => 'foo@example.com', |
|
0 commit comments