Fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-11-27 14:51:14 +01:00
parent d441864cd0
commit 078f4efb20
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 40 additions and 3 deletions

View File

@ -131,6 +131,21 @@ class SharingTest extends TestCase {
->method('getAppValue') ->method('getAppValue')
->with('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL) ->with('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL)
->willReturn(Constants::PERMISSION_ALL); ->willReturn(Constants::PERMISSION_ALL);
$this->config
->expects($this->at(14))
->method('getAppValue')
->with('core', 'shareapi_default_internal_expire_date', 'no')
->willReturn('no');
$this->config
->expects($this->at(15))
->method('getAppValue')
->with('core', 'shareapi_internal_expire_after_n_days', '7')
->willReturn('7');
$this->config
->expects($this->at(16))
->method('getAppValue')
->with('core', 'shareapi_enforce_internal_expire_date', 'no')
->willReturn('no');
$expected = new TemplateResponse( $expected = new TemplateResponse(
'settings', 'settings',
@ -152,7 +167,10 @@ class SharingTest extends TestCase {
'publicShareDisclaimerText' => 'Lorem ipsum', 'publicShareDisclaimerText' => 'Lorem ipsum',
'enableLinkPasswordByDefault' => 'yes', 'enableLinkPasswordByDefault' => 'yes',
'shareApiDefaultPermissions' => Constants::PERMISSION_ALL, 'shareApiDefaultPermissions' => Constants::PERMISSION_ALL,
'shareApiDefaultPermissionsCheckboxes' => $this->invokePrivate($this->admin, 'getSharePermissionList', []) 'shareApiDefaultPermissionsCheckboxes' => $this->invokePrivate($this->admin, 'getSharePermissionList', []),
'shareDefaultInternalExpireDateSet' => 'no',
'shareInternalExpireAfterNDays' => '7',
'shareInternalEnforceExpireDate' => 'no',
], ],
'' ''
); );
@ -231,6 +249,21 @@ class SharingTest extends TestCase {
->method('getAppValue') ->method('getAppValue')
->with('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL) ->with('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL)
->willReturn(Constants::PERMISSION_ALL); ->willReturn(Constants::PERMISSION_ALL);
$this->config
->expects($this->at(14))
->method('getAppValue')
->with('core', 'shareapi_default_internal_expire_date', 'no')
->willReturn('no');
$this->config
->expects($this->at(15))
->method('getAppValue')
->with('core', 'shareapi_internal_expire_after_n_days', '7')
->willReturn('7');
$this->config
->expects($this->at(16))
->method('getAppValue')
->with('core', 'shareapi_enforce_internal_expire_date', 'no')
->willReturn('no');
$expected = new TemplateResponse( $expected = new TemplateResponse(
@ -253,7 +286,10 @@ class SharingTest extends TestCase {
'publicShareDisclaimerText' => 'Lorem ipsum', 'publicShareDisclaimerText' => 'Lorem ipsum',
'enableLinkPasswordByDefault' => 'yes', 'enableLinkPasswordByDefault' => 'yes',
'shareApiDefaultPermissions' => Constants::PERMISSION_ALL, 'shareApiDefaultPermissions' => Constants::PERMISSION_ALL,
'shareApiDefaultPermissionsCheckboxes' => $this->invokePrivate($this->admin, 'getSharePermissionList', []) 'shareApiDefaultPermissionsCheckboxes' => $this->invokePrivate($this->admin, 'getSharePermissionList', []),
'shareDefaultInternalExpireDateSet' => 'no',
'shareInternalExpireAfterNDays' => '7',
'shareInternalEnforceExpireDate' => 'no',
], ],
'' ''
); );

View File

@ -1743,7 +1743,8 @@ class ManagerTest extends \Test\TestCase {
->with($path); ->with($path);
$manager->expects($this->once()) $manager->expects($this->once())
->method('validateExpirationDate') ->method('validateExpirationDate')
->with($share); ->with($share)
->willReturn($share);
$manager->expects($this->once()) $manager->expects($this->once())
->method('verifyPassword') ->method('verifyPassword')
->with('password'); ->with('password');