diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2022-04-26 19:25:22 +0300 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2022-04-28 19:05:31 +0300 |
commit | 738dde801849b1271870a846bcf5dde35dc7034b (patch) | |
tree | e184d2161170de843f6c1c7d6afd982110368ec4 /tests | |
parent | 27fe2975aac226aad344d7a54b0858d136565d91 (diff) |
Disable scheduled sending if ajax cron is used
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Unit/Controller/PageControllerTest.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php index fe9dff6e6..2557cd4f6 100644 --- a/tests/Unit/Controller/PageControllerTest.php +++ b/tests/Unit/Controller/PageControllerTest.php @@ -211,10 +211,15 @@ class PageControllerTest extends TestCase { ['debug', false, true], ['app.mail.attachment-size-limit', 0, 123], ]); - $this->config->expects($this->once()) + $this->config->expects($this->exactly(2)) ->method('getAppValue') - ->with('mail', 'installed_version') - ->will($this->returnValue('1.2.3')); + ->withConsecutive( + [ 'mail', 'installed_version' ], + ['core', 'backgroundjobs_mode', 'ajax' ] + )->willReturnOnConsecutiveCalls( + $this->returnValue('1.2.3'), + $this->returnValue('cron') + ); $user->expects($this->once()) ->method('getDisplayName') ->will($this->returnValue('Jane Doe')); @@ -225,7 +230,7 @@ class PageControllerTest extends TestCase { ->with($this->equalTo('jane'), $this->equalTo('settings'), $this->equalTo('email'), $this->equalTo('')) ->will($this->returnValue('jane@doe.cz')); - $this->initialState->expects($this->exactly(7)) + $this->initialState->expects($this->exactly(8)) ->method('provideInitialState') ->withConsecutive( ['debug', true], @@ -234,7 +239,8 @@ class PageControllerTest extends TestCase { ['tags', []], ['prefill_displayName', 'Jane Doe'], ['prefill_email', 'jane@doe.cz'], - ['outbox-messages', []] + ['outbox-messages', []], + ['disable-scheduled-send', false] ); $expected = new TemplateResponse($this->appName, 'index', |