Skip to content

Commit e245f8e

Browse files
committed
Adress previous test faillure with in-memory db
1 parent ab09c29 commit e245f8e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

app/sprinkles/account/tests/Integration/Controller/AccountControllerTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ public function testRegisterWithNoEmailVerification()
157157
'en_US' => 'English',
158158
];
159159

160+
// Bypass security feature
161+
$fm = $this->ci->factory;
162+
$dummyUser = $fm->create(User::class);
163+
$this->ci->config['reserved_user_ids.master'] = $dummyUser->id;
164+
160165
// Recreate controller to use fake config
161166
$controller = $this->getController();
162167

@@ -1106,6 +1111,11 @@ public function testRegisterWithFailedThrottle()
11061111
$throttler->shouldReceive('getDelay')->once()->with('registration_attempt')->andReturn(90);
11071112
$this->ci->throttler = $throttler;
11081113

1114+
// Bypass security feature
1115+
$fm = $this->ci->factory;
1116+
$dummyUser = $fm->create(User::class);
1117+
$this->ci->config['reserved_user_ids.master'] = $dummyUser->id;
1118+
11091119
// Recreate controller to use fake throttler
11101120
$controller = $this->getController();
11111121

@@ -1128,6 +1138,11 @@ public function testRegisterWithFailedThrottle()
11281138
*/
11291139
public function testRegisterWithFailedCaptcha(AccountController $controller)
11301140
{
1141+
// Bypass security feature
1142+
$fm = $this->ci->factory;
1143+
$dummyUser = $fm->create(User::class);
1144+
$this->ci->config['reserved_user_ids.master'] = $dummyUser->id;
1145+
11311146
// Set POST
11321147
$request = $this->getRequest()->withParsedBody([
11331148
'spiderbro' => 'http://',
@@ -1152,6 +1167,11 @@ public function testRegisterWithFailedCaptcha(AccountController $controller)
11521167
*/
11531168
public function testRegisterWithFailedValidation(AccountController $controller)
11541169
{
1170+
// Bypass security feature
1171+
$fm = $this->ci->factory;
1172+
$dummyUser = $fm->create(User::class);
1173+
$this->ci->config['reserved_user_ids.master'] = $dummyUser->id;
1174+
11551175
// Set POST
11561176
$request = $this->getRequest()->withParsedBody([
11571177
'spiderbro' => 'http://',

0 commit comments

Comments
 (0)