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
8077ea3f
Commit
8077ea3f
authored
May 07, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silenced migrations output in rbac test in case there's no error
parent
a86d2ad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
DbManagerTestCase.php
tests/unit/framework/rbac/DbManagerTestCase.php
+13
-4
No files found.
tests/unit/framework/rbac/DbManagerTestCase.php
View file @
8077ea3f
...
...
@@ -3,6 +3,7 @@ namespace yiiunit\framework\rbac;
use
Yii
;
use
yii\console\Application
;
use
yii\console\Controller
;
use
yii\console\controllers\MigrateController
;
use
yii\db\Connection
;
use
yii\rbac\DbManager
;
...
...
@@ -20,7 +21,7 @@ abstract class DbManagerTestCase extends ManagerTestCase
*/
protected
static
$db
;
p
ublic
static
function
getApplication
(
)
p
rotected
static
function
runConsoleAction
(
$route
,
$params
=
[]
)
{
if
(
Yii
::
$app
===
null
)
{
new
Application
([
...
...
@@ -32,7 +33,15 @@ abstract class DbManagerTestCase extends ManagerTestCase
],
]);
}
return
Yii
::
$app
;
ob_start
();
$result
=
Yii
::
$app
->
runAction
(
'migrate/up'
,
[
'migrationPath'
=>
'@yii/rbac/migrations/'
,
'interactive'
=>
false
]);
echo
"Result is "
.
$result
;
if
(
$result
!==
Controller
::
EXIT_CODE_NORMAL
)
{
ob_end_flush
();
}
else
{
ob_end_clean
();
}
}
public
static
function
setUpBeforeClass
()
...
...
@@ -46,12 +55,12 @@ abstract class DbManagerTestCase extends ManagerTestCase
static
::
markTestSkipped
(
'pdo and '
.
$pdo_database
.
' extension are required.'
);
}
static
::
getApplication
()
->
run
Action
(
'migrate/up'
,
[
'migrationPath'
=>
'@yii/rbac/migrations/'
,
'interactive'
=>
false
]);
static
::
runConsole
Action
(
'migrate/up'
,
[
'migrationPath'
=>
'@yii/rbac/migrations/'
,
'interactive'
=>
false
]);
}
public
static
function
tearDownAfterClass
()
{
static
::
getApplication
()
->
run
Action
(
'migrate/down'
,
[
'migrationPath'
=>
'@yii/rbac/migrations/'
,
'interactive'
=>
false
]);
static
::
runConsole
Action
(
'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