Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fetch proper translations
Fixes #14793

This is caused by the mess we have with OC\Settings mapping to settings
and lib/private/Settings.

Anyway this is the quick fix. Moving stuff around for 17 seems better.

Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer committed Mar 25, 2019
commit a7fb71f908f081d941981a62ed80e8bf58c15c07
5 changes: 3 additions & 2 deletions lib/private/Settings/Admin/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use OCP\Constants;
use OCP\IConfig;
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\Settings\ISettings;
use OCP\Share\IManager;
use OCP\Util;
Expand All @@ -48,9 +49,9 @@ class Sharing implements ISettings {
/**
* @param IConfig $config
*/
public function __construct(IConfig $config, IL10N $l, IManager $shareManager) {
public function __construct(IConfig $config, IFactory $l, IManager $shareManager) {
$this->config = $config;
$this->l = $l;
$this->l = $l->get('lib');
$this->shareManager = $shareManager;
}

Expand Down
8 changes: 7 additions & 1 deletion tests/lib/Settings/Admin/SharingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use OCP\Constants;
use OCP\IConfig;
use OCP\IL10N;
use OCP\L10N\IFactory;
use OCP\Share\IManager;
use Test\TestCase;

Expand All @@ -45,11 +46,16 @@ public function setUp() {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
$this->l10n = $this->getMockBuilder(IL10N::class)->getMock();

$l10Factory = $this->createMock(IFactory::class);
$l10Factory->method('get')
->willReturn($this->l10n);

$this->shareManager = $this->getMockBuilder(IManager::class)->getMock();

$this->admin = new Sharing(
$this->config,
$this->l10n,
$l10Factory,
$this->shareManager
);
}
Expand Down