l10n: Fix test
This commit is contained in:
parent
e7648c2fdd
commit
1627eb45bb
|
@ -596,7 +596,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
[$this->createShare(null, IShare::TYPE_GROUP, $file, $group0, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
[$this->createShare(null, IShare::TYPE_GROUP, $file, $group0, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||||
[$this->createShare(null, IShare::TYPE_LINK, $file, null, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
[$this->createShare(null, IShare::TYPE_LINK, $file, null, null, $user0, 31, null, null), 'SharedBy should be set', true],
|
||||||
|
|
||||||
[$this->createShare(null, IShare::TYPE_USER, $file, $user0, $user0, $user0, 31, null, null), 'Can’t share with yourself', true],
|
[$this->createShare(null, IShare::TYPE_USER, $file, $user0, $user0, $user0, 31, null, null), 'Cannot share with yourself', true],
|
||||||
|
|
||||||
[$this->createShare(null, IShare::TYPE_USER, null, $user2, $user0, $user0, 31, null, null), 'Path should be set', true],
|
[$this->createShare(null, IShare::TYPE_USER, null, $user2, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||||
[$this->createShare(null, IShare::TYPE_GROUP, null, $group0, $user0, $user0, 31, null, null), 'Path should be set', true],
|
[$this->createShare(null, IShare::TYPE_GROUP, null, $group0, $user0, $user0, 31, null, null), 'Path should be set', true],
|
||||||
|
@ -639,9 +639,9 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$limitedPermssions->method('getMountPoint')->willReturn($mount);
|
$limitedPermssions->method('getMountPoint')->willReturn($mount);
|
||||||
|
|
||||||
|
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $limitedPermssions, $user2, $user0, $user0, 31, null, null), 'Can’t increase permissions of path', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_USER, $limitedPermssions, $user2, $user0, $user0, 31, null, null), 'Cannot increase permissions of path', true];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, 17, null, null), 'Can’t increase permissions of path', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, 17, null, null), 'Cannot increase permissions of path', true];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Can’t increase permissions of path', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Cannot increase permissions of path', true];
|
||||||
|
|
||||||
$nonMoveableMountPermssions = $this->createMock(Folder::class);
|
$nonMoveableMountPermssions = $this->createMock(Folder::class);
|
||||||
$nonMoveableMountPermssions->method('isShareable')->willReturn(true);
|
$nonMoveableMountPermssions->method('isShareable')->willReturn(true);
|
||||||
|
@ -654,17 +654,17 @@ class ManagerTest extends \Test\TestCase {
|
||||||
$nonMoveableMountPermssions->method('getStorage')
|
$nonMoveableMountPermssions->method('getStorage')
|
||||||
->willReturn($storage);
|
->willReturn($storage);
|
||||||
|
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $nonMoveableMountPermssions, $user2, $user0, $user0, 11, null, null), 'Can’t increase permissions of path', false];
|
$data[] = [$this->createShare(null, IShare::TYPE_USER, $nonMoveableMountPermssions, $user2, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $nonMoveableMountPermssions, $group0, $user0, $user0, 11, null, null), 'Can’t increase permissions of path', false];
|
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $nonMoveableMountPermssions, $group0, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false];
|
||||||
|
|
||||||
$rootFolder = $this->createMock(Folder::class);
|
$rootFolder = $this->createMock(Folder::class);
|
||||||
$rootFolder->method('isShareable')->willReturn(true);
|
$rootFolder->method('isShareable')->willReturn(true);
|
||||||
$rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
|
$rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
|
||||||
$rootFolder->method('getId')->willReturn(42);
|
$rootFolder->method('getId')->willReturn(42);
|
||||||
|
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_USER, $rootFolder, $user2, $user0, $user0, 30, null, null), 'You can’t share your root folder', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_USER, $rootFolder, $user2, $user0, $user0, 30, null, null), 'You cannot share your root folder', true];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $rootFolder, $group0, $user0, $user0, 2, null, null), 'You can’t share your root folder', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $rootFolder, $group0, $user0, $user0, 2, null, null), 'You cannot share your root folder', true];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $rootFolder, null, $user0, $user0, 16, null, null), 'You can’t share your root folder', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $rootFolder, null, $user0, $user0, 16, null, null), 'You cannot share your root folder', true];
|
||||||
|
|
||||||
$allPermssions = $this->createMock(Folder::class);
|
$allPermssions = $this->createMock(Folder::class);
|
||||||
$allPermssions->method('isShareable')->willReturn(true);
|
$allPermssions->method('isShareable')->willReturn(true);
|
||||||
|
@ -697,7 +697,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
->willReturn($storage);
|
->willReturn($storage);
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_REMOTE, $remoteFile, $user2, $user0, $user0, 1, null, null), null, false];
|
$data[] = [$this->createShare(null, IShare::TYPE_REMOTE, $remoteFile, $user2, $user0, $user0, 1, null, null), null, false];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_REMOTE, $remoteFile, $user2, $user0, $user0, 3, null, null), null, false];
|
$data[] = [$this->createShare(null, IShare::TYPE_REMOTE, $remoteFile, $user2, $user0, $user0, 3, null, null), null, false];
|
||||||
$data[] = [$this->createShare(null, IShare::TYPE_REMOTE, $remoteFile, $user2, $user0, $user0, 31, null, null), 'Can’t increase permissions of ', true];
|
$data[] = [$this->createShare(null, IShare::TYPE_REMOTE, $remoteFile, $user2, $user0, $user0, 31, null, null), 'Cannot increase permissions of ', true];
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -753,7 +753,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testGeneralCheckShareRoot() {
|
public function testGeneralCheckShareRoot() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('You can’t share your root folder');
|
$this->expectExceptionMessage('You cannot share your root folder');
|
||||||
|
|
||||||
$thrown = null;
|
$thrown = null;
|
||||||
|
|
||||||
|
@ -925,7 +925,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
*/
|
*/
|
||||||
public function testValidateExpirationDateInternalEnforceTooFarIntoFuture($shareType) {
|
public function testValidateExpirationDateInternalEnforceTooFarIntoFuture($shareType) {
|
||||||
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
|
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
|
||||||
$this->expectExceptionMessage('Can’t set expiration date more than 3 days in the future');
|
$this->expectExceptionMessage('Cannot set expiration date more than 3 days in the future');
|
||||||
|
|
||||||
$future = new \DateTime();
|
$future = new \DateTime();
|
||||||
$future->add(new \DateInterval('P7D'));
|
$future->add(new \DateInterval('P7D'));
|
||||||
|
@ -1286,7 +1286,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testValidateExpirationDateEnforceTooFarIntoFuture() {
|
public function testValidateExpirationDateEnforceTooFarIntoFuture() {
|
||||||
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
|
$this->expectException(\OCP\Share\Exceptions\GenericShareException::class);
|
||||||
$this->expectExceptionMessage('Can’t set expiration date more than 3 days in the future');
|
$this->expectExceptionMessage('Cannot set expiration date more than 3 days in the future');
|
||||||
|
|
||||||
$future = new \DateTime();
|
$future = new \DateTime();
|
||||||
$future->add(new \DateInterval('P7D'));
|
$future->add(new \DateInterval('P7D'));
|
||||||
|
@ -2970,7 +2970,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareCantChangeShareType() {
|
public function testUpdateShareCantChangeShareType() {
|
||||||
$this->expectException(\Exception::class);
|
$this->expectException(\Exception::class);
|
||||||
$this->expectExceptionMessage('Can’t change share type');
|
$this->expectExceptionMessage('Cannot change share type');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3024,7 +3024,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareCantShareWithOwner() {
|
public function testUpdateShareCantShareWithOwner() {
|
||||||
$this->expectException(\Exception::class);
|
$this->expectException(\Exception::class);
|
||||||
$this->expectExceptionMessage('Can’t share with the share owner');
|
$this->expectExceptionMessage('Cannot share with the share owner');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3238,7 +3238,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareLinkEnableSendPasswordByTalkWithNoPassword() {
|
public function testUpdateShareLinkEnableSendPasswordByTalkWithNoPassword() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t enable sending the password by Talk with an empty password');
|
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3558,7 +3558,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareMailEnableSendPasswordByTalkWithNoPassword() {
|
public function testUpdateShareMailEnableSendPasswordByTalkWithNoPassword() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t enable sending the password by Talk with an empty password');
|
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3631,7 +3631,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareMailEnableSendPasswordByTalkRemovingPassword() {
|
public function testUpdateShareMailEnableSendPasswordByTalkRemovingPassword() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t enable sending the password by Talk with an empty password');
|
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3704,7 +3704,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareMailEnableSendPasswordByTalkRemovingPasswordWithEmptyString() {
|
public function testUpdateShareMailEnableSendPasswordByTalkRemovingPasswordWithEmptyString() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t enable sending the password by Talk with an empty password');
|
$this->expectExceptionMessage('Cannot enable sending the password by Talk with an empty password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3777,7 +3777,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareMailEnableSendPasswordByTalkWithPreviousPassword() {
|
public function testUpdateShareMailEnableSendPasswordByTalkWithPreviousPassword() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t enable sending the password by Talk without setting a new password');
|
$this->expectExceptionMessage('Cannot enable sending the password by Talk without setting a new password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3851,7 +3851,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareMailDisableSendPasswordByTalkWithPreviousPassword() {
|
public function testUpdateShareMailDisableSendPasswordByTalkWithPreviousPassword() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t disable sending the password by Talk without setting a new password');
|
$this->expectExceptionMessage('Cannot disable sending the password by Talk without setting a new password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3925,7 +3925,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testUpdateShareMailDisableSendPasswordByTalkWithoutChangingPassword() {
|
public function testUpdateShareMailDisableSendPasswordByTalkWithoutChangingPassword() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t disable sending the password by Talk without setting a new password');
|
$this->expectExceptionMessage('Cannot disable sending the password by Talk without setting a new password');
|
||||||
|
|
||||||
$manager = $this->createManagerMock()
|
$manager = $this->createManagerMock()
|
||||||
->setMethods([
|
->setMethods([
|
||||||
|
@ -3999,7 +3999,7 @@ class ManagerTest extends \Test\TestCase {
|
||||||
|
|
||||||
public function testMoveShareLink() {
|
public function testMoveShareLink() {
|
||||||
$this->expectException(\InvalidArgumentException::class);
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
$this->expectExceptionMessage('Can’t change target of link share');
|
$this->expectExceptionMessage('Cannot change target of link share');
|
||||||
|
|
||||||
$share = $this->manager->newShare();
|
$share = $this->manager->newShare();
|
||||||
$share->setShareType(IShare::TYPE_LINK);
|
$share->setShareType(IShare::TYPE_LINK);
|
||||||
|
|
Loading…
Reference in New Issue