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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
d70a4a96
Commit
d70a4a96
authored
11 years ago
by
Christopher Schäpers
Browse files
Options
Downloads
Patches
Plain Diff
Use setUpBeforeClass() and tearDownAfterClass()
parent
56549daf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lib/appconfig.php
+9
-3
9 additions, 3 deletions
tests/lib/appconfig.php
with
9 additions
and
3 deletions
tests/lib/appconfig.php
+
9
−
3
View file @
d70a4a96
...
...
@@ -7,7 +7,7 @@
*/
class
Test_Appconfig
extends
PHPUnit_Framework_TestCase
{
p
rivate
function
fillDb
()
{
p
ublic
static
function
setUpBeforeClass
()
{
$query
=
\OC_DB
::
prepare
(
'INSERT INTO `*PREFIX*appconfig` VALUES (?, ?, ?)'
);
$query
->
execute
(
array
(
'testapp'
,
'enabled'
,
'true'
));
...
...
@@ -26,9 +26,15 @@ class Test_Appconfig extends PHPUnit_Framework_TestCase {
$query
->
execute
(
array
(
'anotherapp'
,
'enabled'
,
'false'
));
}
public
function
testGetApps
()
{
$this
->
fillDb
();
public
static
function
tearDownAfterClass
()
{
$query
=
\OC_DB
::
prepare
(
'DELETE FROM `*PREFIX*appconfig` WHERE `appid` = ?'
);
$query
->
execute
(
array
(
'testapp'
));
$query
->
execute
(
array
(
'someapp'
));
$query
->
execute
(
array
(
'123456'
));
$query
->
execute
(
array
(
'anotherapp'
));
}
public
function
testGetApps
()
{
$query
=
\OC_DB
::
prepare
(
'SELECT DISTINCT `appid` FROM `*PREFIX*appconfig`'
);
$result
=
$query
->
execute
();
$expected
=
array
();
...
...
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