Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
440c402b
Commit
440c402b
authored
May 07, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified RBAC DB manager test
parent
ef4d9683
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
22 deletions
+11
-22
DbManagerTestCase.php
tests/unit/framework/rbac/DbManagerTestCase.php
+11
-22
No files found.
tests/unit/framework/rbac/DbManagerTestCase.php
View file @
440c402b
...
...
@@ -19,26 +19,6 @@ abstract class DbManagerTestCase extends ManagerTestCase
*/
protected
static
$db
;
/**
* @return MigrateController
*/
protected
static
function
getMigrator
()
{
$app
=
new
Application
([
'id'
=>
'Migrator'
,
'basePath'
=>
'@yiiunit'
,
'components'
=>
[
'db'
=>
static
::
getConnection
(),
'authManager'
=>
'\yii\rbac\DbManager'
,
],
]);
$migrator
=
new
MigrateController
(
'migrate'
,
$app
,
[]);
$migrator
->
migrationPath
=
'@yii/rbac/migrations/'
;
$migrator
->
interactive
=
false
;
return
$migrator
;
}
public
static
function
setUpBeforeClass
()
{
parent
::
setUpBeforeClass
();
...
...
@@ -50,12 +30,21 @@ abstract class DbManagerTestCase extends ManagerTestCase
static
::
markTestSkipped
(
'pdo and '
.
$pdo_database
.
' extension are required.'
);
}
static
::
getMigrator
()
->
run
(
'up'
);
new
Application
([
'id'
=>
'Migrator'
,
'basePath'
=>
'@yiiunit'
,
'components'
=>
[
'db'
=>
static
::
getConnection
(),
'authManager'
=>
'\yii\rbac\DbManager'
,
],
]);
\Yii
::
$app
->
runAction
(
'migrate/up'
,
[
'migrationPath'
=>
'@yii/rbac/migrations/'
,
'interactive'
=>
false
]);
}
public
static
function
tearDownAfterClass
()
{
static
::
getMigrator
()
->
run
(
'down'
);
\Yii
::
$app
->
runAction
(
'migrate/down'
,
[
'migrationPath'
=>
'@yii/rbac/migrations/'
,
'interactive'
=>
false
]
);
if
(
static
::
$db
)
{
static
::
$db
->
close
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment