fix test and make warning translatable

This commit is contained in:
Bjoern Schiessle 2013-08-01 14:19:33 +02:00
parent 9253627327
commit 69173c2a6b
2 changed files with 9 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -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);