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
48f38844
Commit
48f38844
authored
May 11, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mocking time in test only usefull when using time() once
https://github.com/yiisoft/yii2/commit/e2513de6c6207fa37894a944e10b8cd420ac6804#commitcomment-3192244
parent
e2513de6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
DbCacheTest.php
tests/unit/framework/caching/DbCacheTest.php
+3
-2
FileCacheTest.php
tests/unit/framework/caching/FileCacheTest.php
+3
-2
No files found.
tests/unit/framework/caching/DbCacheTest.php
View file @
48f38844
...
...
@@ -77,10 +77,11 @@ class DbCacheTest extends CacheTest
{
$cache
=
$this
->
getCacheInstance
();
static
::
$time
=
\time
();
$this
->
assertTrue
(
$cache
->
set
(
'expire_test'
,
'expire_test'
,
2
));
static
::
$time
=
time
()
+
1
;
static
::
$time
++
;
$this
->
assertEquals
(
'expire_test'
,
$cache
->
get
(
'expire_test'
));
static
::
$time
=
time
()
+
2
;
static
::
$time
++
;
$this
->
assertFalse
(
$cache
->
get
(
'expire_test'
));
}
}
tests/unit/framework/caching/FileCacheTest.php
View file @
48f38844
...
...
@@ -27,10 +27,11 @@ class FileCacheTest extends CacheTest
{
$cache
=
$this
->
getCacheInstance
();
static
::
$time
=
\time
();
$this
->
assertTrue
(
$cache
->
set
(
'expire_test'
,
'expire_test'
,
2
));
static
::
$time
=
time
()
+
1
;
static
::
$time
++
;
$this
->
assertEquals
(
'expire_test'
,
$cache
->
get
(
'expire_test'
));
static
::
$time
=
time
()
+
2
;
static
::
$time
++
;
$this
->
assertFalse
(
$cache
->
get
(
'expire_test'
));
}
}
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