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
1dad82a0
Commit
1dad82a0
authored
Jul 30, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid random test break
parent
7af92173
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
PhpManagerTest.php
tests/unit/framework/rbac/PhpManagerTest.php
+16
-0
No files found.
tests/unit/framework/rbac/PhpManagerTest.php
View file @
1dad82a0
<?php
<?php
namespace
yii\rbac
;
/**
* Mock for the filemtime() function for rbac classes. Avoid random test fails.
* @return int
*/
function
filemtime
(
$file
)
{
return
\yiiunit\framework\rbac\PhpManagerTest
::
$filemtime
?:
\filemtime
(
$file
);
}
namespace
yiiunit\framework\rbac
;
namespace
yiiunit\framework\rbac
;
use
Yii
;
use
Yii
;
...
@@ -10,6 +21,8 @@ use Yii;
...
@@ -10,6 +21,8 @@ use Yii;
*/
*/
class
PhpManagerTest
extends
ManagerTestCase
class
PhpManagerTest
extends
ManagerTestCase
{
{
public
static
$filemtime
;
protected
function
getItemFile
()
protected
function
getItemFile
()
{
{
return
Yii
::
$app
->
getRuntimePath
()
.
'/rbac-items.php'
;
return
Yii
::
$app
->
getRuntimePath
()
.
'/rbac-items.php'
;
...
@@ -46,6 +59,7 @@ class PhpManagerTest extends ManagerTestCase
...
@@ -46,6 +59,7 @@ class PhpManagerTest extends ManagerTestCase
protected
function
setUp
()
protected
function
setUp
()
{
{
static
::
$filemtime
=
null
;
parent
::
setUp
();
parent
::
setUp
();
$this
->
mockApplication
();
$this
->
mockApplication
();
$this
->
removeDataFiles
();
$this
->
removeDataFiles
();
...
@@ -55,11 +69,13 @@ class PhpManagerTest extends ManagerTestCase
...
@@ -55,11 +69,13 @@ class PhpManagerTest extends ManagerTestCase
protected
function
tearDown
()
protected
function
tearDown
()
{
{
$this
->
removeDataFiles
();
$this
->
removeDataFiles
();
static
::
$filemtime
=
null
;
parent
::
tearDown
();
parent
::
tearDown
();
}
}
public
function
testSaveLoad
()
public
function
testSaveLoad
()
{
{
static
::
$filemtime
=
time
();
$this
->
prepareData
();
$this
->
prepareData
();
$items
=
$this
->
auth
->
items
;
$items
=
$this
->
auth
->
items
;
...
...
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