]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix test and make warning translatable
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 1 Aug 2013 12:19:33 +0000 (14:19 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 1 Aug 2013 12:19:33 +0000 (14:19 +0200)
apps/files_encryption/hooks/hooks.php
apps/files_encryption/tests/share.php

index be95037784e676909189c6f87adc43cccc0c7a0e..741df166b70179ce5c3c089097e2f619ce12408f 100644 (file)
@@ -238,6 +238,7 @@ class Hooks {
         */\r
        public static function preShared($params) {\r
 \r
+               $l = new \OC_L10N('files_encryption');\r
                $users = array();\r
                $view = new \OC\Files\View('/public-keys/');\r
 \r
@@ -259,7 +260,7 @@ class Hooks {
 \r
                if (count($notConfigured) > 0) {\r
                        $params['run'] = false;\r
-                       $params['error'] = 'Following users are not set up for encryption: ' . join(', ' , $notConfigured);\r
+                       $params['error'] = $l->t('Following users are not set up for encryption:') . ' ' . join(', ' , $notConfigured);\r
                }\r
                \r
        }\r
index ebf678da78ed2f7f536da7db852c47b34e8a3972..5f3d500509007b1fd2be7b400961d31fcd1fb99b 100755 (executable)
@@ -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);