Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
db968cb1
Unverified
Commit
db968cb1
authored
5 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup the Settings class
Signed-off-by:
Joas Schilling
<
coding@schilljs.com
>
parent
9b89baca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
settings/Settings/Admin/Server.php
+3
-32
3 additions, 32 deletions
settings/Settings/Admin/Server.php
tests/lib/Settings/Admin/ServerTest.php
+2
-23
2 additions, 23 deletions
tests/lib/Settings/Admin/ServerTest.php
with
5 additions
and
55 deletions
settings/Settings/Admin/Server.php
+
3
−
32
View file @
db968cb1
...
...
@@ -26,48 +26,19 @@
namespace
OC\Settings\Admin
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Platforms\SqlitePlatform
;
use
OC\Lock\DBLockingProvider
;
use
OC\Lock\NoopLockingProvider
;
use
OCP\AppFramework\Http\TemplateResponse
;
use
OCP\IConfig
;
use
OCP\IDBConnection
;
use
OCP\IL10N
;
use
OCP\IRequest
;
use
OCP\Lock\ILockingProvider
;
use
OCP\Settings\ISettings
;
class
Server
implements
ISettings
{
/** @var IDBConnection|Connection */
private
$db
;
/** @var IRequest */
private
$request
;
/** @var IConfig */
private
$config
;
/** @var ILockingProvider */
private
$lockingProvider
;
/** @var IL10N */
private
$l
;
/**
* @param IDBConnection $db
* @param IRequest $request
* @param IConfig $config
* @param ILockingProvider $lockingProvider
* @param IL10N $l
*/
public
function
__construct
(
IDBConnection
$db
,
IRequest
$request
,
IConfig
$config
,
ILockingProvider
$lockingProvider
,
IL10N
$l
)
{
$this
->
db
=
$db
;
$this
->
request
=
$request
;
public
function
__construct
(
IConfig
$config
)
{
$this
->
config
=
$config
;
$this
->
lockingProvider
=
$lockingProvider
;
$this
->
l
=
$l
;
}
/**
...
...
@@ -89,7 +60,7 @@ class Server implements ISettings {
/**
* @return string the section ID, e.g. 'sharing'
*/
public
function
getSection
()
{
public
function
getSection
()
:
string
{
return
'server'
;
}
...
...
@@ -100,7 +71,7 @@ class Server implements ISettings {
*
* E.g.: 70
*/
public
function
getPriority
()
{
public
function
getPriority
()
:
int
{
return
0
;
}
}
This diff is collapsed.
Click to expand it.
tests/lib/Settings/Admin/ServerTest.php
+
2
−
23
View file @
db968cb1
...
...
@@ -23,44 +23,23 @@
namespace
Test\Settings\Admin
;
use
Doctrine\DBAL\Platforms\SqlitePlatform
;
use
OC\Settings\Admin\Server
;
use
OCP\AppFramework\Http\TemplateResponse
;
use
OCP\IConfig
;
use
OCP\IDBConnection
;
use
OCP\IL10N
;
use
OCP\IRequest
;
use
OCP\Lock\ILockingProvider
;
use
Test\TestCase
;
class
ServerTest
extends
TestCase
{
/** @var Server */
private
$admin
;
/** @var IDBConnection */
private
$dbConnection
;
/** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */
private
$request
;
/** @var IConfig */
private
$config
;
/** @var ILockingProvider */
private
$lockingProvider
;
/** @var IL10N */
private
$l10n
;
public
function
setUp
()
{
parent
::
setUp
();
$this
->
config
=
$this
->
getMockBuilder
(
IConfig
::
class
)
->
getMock
();
$this
->
request
=
$this
->
createMock
(
IRequest
::
class
);
$this
->
dbConnection
=
$this
->
getMockBuilder
(
'\OCP\IDBConnection'
)
->
getMock
();
$this
->
lockingProvider
=
$this
->
getMockBuilder
(
'\OCP\Lock\ILockingProvider'
)
->
getMock
();
$this
->
l10n
=
$this
->
getMockBuilder
(
IL10N
::
class
)
->
getMock
();
$this
->
config
=
$this
->
createMock
(
IConfig
::
class
);
$this
->
admin
=
new
Server
(
$this
->
dbConnection
,
$this
->
request
,
$this
->
config
,
$this
->
lockingProvider
,
$this
->
l10n
$this
->
config
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment