File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
lib/private/Settings/Admin Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 3131use OCP \Constants ;
3232use OCP \IConfig ;
3333use OCP \IL10N ;
34+ use OCP \L10N \IFactory ;
3435use OCP \Settings \ISettings ;
3536use OCP \Share \IManager ;
3637use OCP \Util ;
@@ -48,9 +49,9 @@ class Sharing implements ISettings {
4849 /**
4950 * @param IConfig $config
5051 */
51- public function __construct (IConfig $ config , IL10N $ l , IManager $ shareManager ) {
52+ public function __construct (IConfig $ config , IFactory $ l , IManager $ shareManager ) {
5253 $ this ->config = $ config ;
53- $ this ->l = $ l ;
54+ $ this ->l = $ l-> get ( ' lib ' ) ;
5455 $ this ->shareManager = $ shareManager ;
5556 }
5657
Original file line number Diff line number Diff line change 2828use OCP \Constants ;
2929use OCP \IConfig ;
3030use OCP \IL10N ;
31+ use OCP \L10N \IFactory ;
3132use OCP \Share \IManager ;
3233use Test \TestCase ;
3334
@@ -45,11 +46,16 @@ public function setUp() {
4546 parent ::setUp ();
4647 $ this ->config = $ this ->getMockBuilder (IConfig::class)->getMock ();
4748 $ this ->l10n = $ this ->getMockBuilder (IL10N ::class)->getMock ();
49+
50+ $ l10Factory = $ this ->createMock (IFactory::class);
51+ $ l10Factory ->method ('get ' )
52+ ->willReturn ($ this ->l10n );
53+
4854 $ this ->shareManager = $ this ->getMockBuilder (IManager::class)->getMock ();
4955
5056 $ this ->admin = new Sharing (
5157 $ this ->config ,
52- $ this -> l10n ,
58+ $ l10Factory ,
5359 $ this ->shareManager
5460 );
5561 }
You can’t perform that action at this time.
0 commit comments