mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-23 02:58:54 +00:00
[Web][Dovecot] imapsync: update to 2.314, refresh OAuth tokens of running jobs, add source presets
This commit is contained in:
15 files changed
+7060
-3406
No files matched your search
@@ -85,6 +85,20 @@ class ApiControllerTest extends TestCase
|
||||
$this->assertSame('*', $_SESSION['return'][0]['log'][3]['oauth_client_secret']);
|
||||
}
|
||||
|
||||
public function testSavingAClientCredentialsSourceReportsAFailedFirstToken(): void
|
||||
{
|
||||
$source = Source::fromRow(['id' => 5, 'name' => 'm365', 'auth_type' => 'XOAUTH2', 'oauth_last_refresh_error' => 'HTTP 401: invalid_client']);
|
||||
$this->sources->method('create')->willReturn($source);
|
||||
$this->sources->method('update')->willReturn($source);
|
||||
|
||||
$this->assertTrue($this->api->addSource(['name' => 'm365']));
|
||||
$this->assertTrue($this->api->editSources([5], ['name' => 'm365']));
|
||||
|
||||
$failed = ['danger', ['imapsync_source_token_refresh_failed', 'm365 (HTTP 401: invalid_client)']];
|
||||
$this->assertSame([$failed, ['success', ['imapsync_source_added', 'm365']], $failed, ['success', ['imapsync_source_modified', 'm365']]],
|
||||
$this->messages());
|
||||
}
|
||||
|
||||
public function testEditJobsKeepsBatchMessageOrder(): void
|
||||
{
|
||||
$this->jobs->method('update')->willReturnCallback(function (int $id, array $data): Job {
|
||||
|
||||
Reference in new issue
Block a user