Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
bc69cb2d
Commit
bc69cb2d
authored
Nov 23, 2015
by
Morris Jobke
Browse files
Options
Downloads
Patches
Plain Diff
fix unit tests
parent
1189528e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/lib/app.php
+7
-2
7 additions, 2 deletions
tests/lib/app.php
tests/lib/app/manager.php
+6
-2
6 additions, 2 deletions
tests/lib/app/manager.php
with
13 additions
and
4 deletions
tests/lib/app.php
+
7
−
2
View file @
bc69cb2d
...
@@ -306,6 +306,7 @@ class Test_App extends \Test\TestCase {
...
@@ -306,6 +306,7 @@ class Test_App extends \Test\TestCase {
'app3'
,
'app3'
,
'appforgroup1'
,
'appforgroup1'
,
'appforgroup12'
,
'appforgroup12'
,
'dav'
,
),
),
false
false
),
),
...
@@ -318,6 +319,7 @@ class Test_App extends \Test\TestCase {
...
@@ -318,6 +319,7 @@ class Test_App extends \Test\TestCase {
'app3'
,
'app3'
,
'appforgroup12'
,
'appforgroup12'
,
'appforgroup2'
,
'appforgroup2'
,
'dav'
,
),
),
false
false
),
),
...
@@ -331,6 +333,7 @@ class Test_App extends \Test\TestCase {
...
@@ -331,6 +333,7 @@ class Test_App extends \Test\TestCase {
'appforgroup1'
,
'appforgroup1'
,
'appforgroup12'
,
'appforgroup12'
,
'appforgroup2'
,
'appforgroup2'
,
'dav'
,
),
),
false
false
),
),
...
@@ -344,6 +347,7 @@ class Test_App extends \Test\TestCase {
...
@@ -344,6 +347,7 @@ class Test_App extends \Test\TestCase {
'appforgroup1'
,
'appforgroup1'
,
'appforgroup12'
,
'appforgroup12'
,
'appforgroup2'
,
'appforgroup2'
,
'dav'
,
),
),
false
,
false
,
),
),
...
@@ -357,6 +361,7 @@ class Test_App extends \Test\TestCase {
...
@@ -357,6 +361,7 @@ class Test_App extends \Test\TestCase {
'appforgroup1'
,
'appforgroup1'
,
'appforgroup12'
,
'appforgroup12'
,
'appforgroup2'
,
'appforgroup2'
,
'dav'
,
),
),
true
,
true
,
),
),
...
@@ -434,11 +439,11 @@ class Test_App extends \Test\TestCase {
...
@@ -434,11 +439,11 @@ class Test_App extends \Test\TestCase {
);
);
$apps
=
\OC_App
::
getEnabledApps
(
true
);
$apps
=
\OC_App
::
getEnabledApps
(
true
);
$this
->
assertEquals
(
array
(
'files'
,
'app3'
),
$apps
);
$this
->
assertEquals
(
array
(
'files'
,
'app3'
,
'dav'
),
$apps
);
// mock should not be called again here
// mock should not be called again here
$apps
=
\OC_App
::
getEnabledApps
(
false
);
$apps
=
\OC_App
::
getEnabledApps
(
false
);
$this
->
assertEquals
(
array
(
'files'
,
'app3'
),
$apps
);
$this
->
assertEquals
(
array
(
'files'
,
'app3'
,
'dav'
),
$apps
);
$this
->
restoreAppConfig
();
$this
->
restoreAppConfig
();
\OC_User
::
setUserId
(
null
);
\OC_User
::
setUserId
(
null
);
...
...
This diff is collapsed.
Click to expand it.
tests/lib/app/manager.php
+
6
−
2
View file @
bc69cb2d
...
@@ -188,7 +188,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
...
@@ -188,7 +188,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$this
->
appConfig
->
setValue
(
'test1'
,
'enabled'
,
'yes'
);
$this
->
appConfig
->
setValue
(
'test1'
,
'enabled'
,
'yes'
);
$this
->
appConfig
->
setValue
(
'test2'
,
'enabled'
,
'no'
);
$this
->
appConfig
->
setValue
(
'test2'
,
'enabled'
,
'no'
);
$this
->
appConfig
->
setValue
(
'test3'
,
'enabled'
,
'["foo"]'
);
$this
->
appConfig
->
setValue
(
'test3'
,
'enabled'
,
'["foo"]'
);
$this
->
assertEquals
([
'test1'
,
'test3'
],
$this
->
manager
->
getInstalledApps
());
$this
->
assertEquals
([
'dav'
,
'files'
,
'test1'
,
'test3'
],
$this
->
manager
->
getInstalledApps
());
}
}
public
function
testGetAppsForUser
()
{
public
function
testGetAppsForUser
()
{
...
@@ -202,7 +202,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
...
@@ -202,7 +202,7 @@ class Manager extends \PHPUnit_Framework_TestCase {
$this
->
appConfig
->
setValue
(
'test2'
,
'enabled'
,
'no'
);
$this
->
appConfig
->
setValue
(
'test2'
,
'enabled'
,
'no'
);
$this
->
appConfig
->
setValue
(
'test3'
,
'enabled'
,
'["foo"]'
);
$this
->
appConfig
->
setValue
(
'test3'
,
'enabled'
,
'["foo"]'
);
$this
->
appConfig
->
setValue
(
'test4'
,
'enabled'
,
'["asd"]'
);
$this
->
appConfig
->
setValue
(
'test4'
,
'enabled'
,
'["asd"]'
);
$this
->
assertEquals
([
'test1'
,
'test3'
],
$this
->
manager
->
getEnabledAppsForUser
(
$user
));
$this
->
assertEquals
([
'dav'
,
'files'
,
'test1'
,
'test3'
],
$this
->
manager
->
getEnabledAppsForUser
(
$user
));
}
}
public
function
testGetAppsNeedingUpgrade
()
{
public
function
testGetAppsNeedingUpgrade
()
{
...
@@ -212,6 +212,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
...
@@ -212,6 +212,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
->
getMock
();
->
getMock
();
$appInfos
=
[
$appInfos
=
[
'dav'
=>
[
'id'
=>
'dav'
],
'files'
=>
[
'id'
=>
'files'
],
'test1'
=>
[
'id'
=>
'test1'
,
'version'
=>
'1.0.1'
,
'requiremax'
=>
'9.0.0'
],
'test1'
=>
[
'id'
=>
'test1'
,
'version'
=>
'1.0.1'
,
'requiremax'
=>
'9.0.0'
],
'test2'
=>
[
'id'
=>
'test2'
,
'version'
=>
'1.0.0'
,
'requiremin'
=>
'8.2.0'
],
'test2'
=>
[
'id'
=>
'test2'
,
'version'
=>
'1.0.0'
,
'requiremin'
=>
'8.2.0'
],
'test3'
=>
[
'id'
=>
'test3'
,
'version'
=>
'1.2.4'
,
'requiremin'
=>
'9.0.0'
],
'test3'
=>
[
'id'
=>
'test3'
,
'version'
=>
'1.2.4'
,
'requiremin'
=>
'9.0.0'
],
...
@@ -250,6 +252,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
...
@@ -250,6 +252,8 @@ class Manager extends \PHPUnit_Framework_TestCase {
->
getMock
();
->
getMock
();
$appInfos
=
[
$appInfos
=
[
'dav'
=>
[
'id'
=>
'dav'
],
'files'
=>
[
'id'
=>
'files'
],
'test1'
=>
[
'id'
=>
'test1'
,
'version'
=>
'1.0.1'
,
'requiremax'
=>
'8.0.0'
],
'test1'
=>
[
'id'
=>
'test1'
,
'version'
=>
'1.0.1'
,
'requiremax'
=>
'8.0.0'
],
'test2'
=>
[
'id'
=>
'test2'
,
'version'
=>
'1.0.0'
,
'requiremin'
=>
'8.2.0'
],
'test2'
=>
[
'id'
=>
'test2'
,
'version'
=>
'1.0.0'
,
'requiremin'
=>
'8.2.0'
],
'test3'
=>
[
'id'
=>
'test3'
,
'version'
=>
'1.2.4'
,
'requiremin'
=>
'9.0.0'
],
'test3'
=>
[
'id'
=>
'test3'
,
'version'
=>
'1.2.4'
,
'requiremin'
=>
'9.0.0'
],
...
...
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