1
0
Fork 0
mirror of synced 2024-07-01 20:50:49 +12:00

fix: anonymous account tests

This commit is contained in:
Torsten Dittmann 2021-04-16 18:50:16 +02:00
parent 2f7f8ab03d
commit 3b989cf6a7
2 changed files with 11 additions and 11 deletions

View file

@ -14,7 +14,7 @@ use Utopia\Config\Config;
require_once __DIR__.'/../init.php'; require_once __DIR__.'/../init.php';
// Runtime::enableCoroutine(SWOOLE_HOOK_ALL); Runtime::enableCoroutine(0);
Console::title('Functions V1 Worker'); Console::title('Functions V1 Worker');
Console::success(APP_NAME.' functions worker v1 has started'); Console::success(APP_NAME.' functions worker v1 has started');
@ -26,7 +26,7 @@ $environments = Config::getParam('environments');
*/ */
$warmupStart = \microtime(true); $warmupStart = \microtime(true);
// Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀 Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀
$dockerUser = App::getEnv('DOCKERHUB_PULL_USERNAME', null); $dockerUser = App::getEnv('DOCKERHUB_PULL_USERNAME', null);
$dockerPass = App::getEnv('DOCKERHUB_PULL_PASSWORD', null); $dockerPass = App::getEnv('DOCKERHUB_PULL_PASSWORD', null);
@ -40,7 +40,7 @@ $warmupStart = \microtime(true);
} }
foreach($environments as $environment) { foreach($environments as $environment) {
// go(function() use ($environment) { go(function() use ($environment) {
$stdout = ''; $stdout = '';
$stderr = ''; $stderr = '';
@ -55,9 +55,9 @@ $warmupStart = \microtime(true);
if(!empty($stderr)) { if(!empty($stderr)) {
Console::error($stderr); Console::error($stderr);
} }
// }); });
} }
// }); });
$warmupEnd = \microtime(true); $warmupEnd = \microtime(true);
$warmupTime = $warmupEnd - $warmupStart; $warmupTime = $warmupEnd - $warmupStart;

View file

@ -261,7 +261,7 @@ class AccountCustomClientTest extends Scope
/** /**
* @depends testCreateAnonymousAccount * @depends testCreateAnonymousAccount
*/ */
public function testUpdateAnonymousAccountPassword($session):array public function testUpdateAnonymousAccountPassword($session)
{ {
/** /**
* Test for FAILURE * Test for FAILURE
@ -278,13 +278,13 @@ class AccountCustomClientTest extends Scope
$this->assertEquals($response['headers']['status-code'], 400); $this->assertEquals($response['headers']['status-code'], 400);
return []; return $session;
} }
/** /**
* @depends testUpdateAnonymousAccountPassword * @depends testUpdateAnonymousAccountPassword
*/ */
public function testUpdateAnonymousAccountEmail($session):array public function testUpdateAnonymousAccountEmail($session)
{ {
$email = uniqid().'new@localhost.test'; $email = uniqid().'new@localhost.test';
@ -301,12 +301,12 @@ class AccountCustomClientTest extends Scope
'password' => '', 'password' => '',
]); ]);
$this->assertEquals(401, $response['headers']['status-code']); $this->assertEquals(400, $response['headers']['status-code']);
return []; return [];
} }
public function testConvertAnonymousAccount():array public function testConvertAnonymousAccount()
{ {
$session = $this->testCreateAnonymousAccount(); $session = $this->testCreateAnonymousAccount();
$email = uniqid().'new@localhost.test'; $email = uniqid().'new@localhost.test';
@ -372,7 +372,7 @@ class AccountCustomClientTest extends Scope
return []; return [];
} }
public function testConvertAnonymousAccountOAuth2():array public function testConvertAnonymousAccountOAuth2()
{ {
$session = $this->testCreateAnonymousAccount(); $session = $this->testCreateAnonymousAccount();
$provider = 'mock'; $provider = 'mock';