From: Bjoern Schiessle Date: Thu, 1 Aug 2013 12:19:33 +0000 (+0200) Subject: fix test and make warning translatable X-Git-Tag: v6.0.0alpha2~372^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=69173c2a6bad0646efcebe9815fbd18c57665ebd;p=nextcloud-server.git fix test and make warning translatable --- diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index be95037784e..741df166b70 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -238,6 +238,7 @@ class Hooks { */ public static function preShared($params) { + $l = new \OC_L10N('files_encryption'); $users = array(); $view = new \OC\Files\View('/public-keys/'); @@ -259,7 +260,7 @@ class Hooks { if (count($notConfigured) > 0) { $params['run'] = false; - $params['error'] = 'Following users are not set up for encryption: ' . join(', ' , $notConfigured); + $params['error'] = $l->t('Following users are not set up for encryption:') . ' ' . join(', ' , $notConfigured); } } diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php index ebf678da78e..5f3d5005090 100755 --- a/apps/files_encryption/tests/share.php +++ b/apps/files_encryption/tests/share.php @@ -881,8 +881,13 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { \OC_FileProxy::$enabled = $proxyStatus; // share the file - \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, OCP\PERMISSION_ALL); - + try { + \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1, OCP\PERMISSION_ALL); + } catch (Exception $e) { + $this->assertEquals(0, strpos($e->getMessage(), "Following users are not set up for encryption")); + } + + // login as admin \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);