File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed
src/Symfony/Components/DependencyInjection
tests/unit/Symfony/Components/DependencyInjection Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -49,18 +49,13 @@ public function getResource()
49
49
*
50
50
* @return Boolean true if the resource has not been updated, false otherwise
51
51
*/
52
- public function isUptodate ($ timestamp = null )
52
+ public function isUptodate ($ timestamp )
53
53
{
54
54
if (!file_exists ($ this ->resource ))
55
55
{
56
56
return false ;
57
57
}
58
58
59
- if (null === $ timestamp )
60
- {
61
- $ timestamp = time ();
62
- }
63
-
64
59
return filemtime ($ this ->resource ) < $ timestamp ;
65
60
}
66
61
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ interface ResourceInterface
27
27
*
28
28
* @return Boolean true if the resource has not been updated, false otherwise
29
29
*/
30
- function isUptodate ($ timestamp = null );
30
+ function isUptodate ($ timestamp );
31
31
32
32
/**
33
33
* Returns the resource tied to this Resource.
Original file line number Diff line number Diff line change 12
12
13
13
use Symfony \Components \DependencyInjection \FileResource ;
14
14
15
- $ t = new LimeTest (5 );
15
+ $ t = new LimeTest (4 );
16
16
17
17
// ->getResource()
18
18
$ t ->diag ('->getResource() ' );
23
23
24
24
// ->isUptodate()
25
25
$ t ->diag ('->isUptodate() ' );
26
- sleep (1 );
27
- $ t ->ok ($ resource ->isUptodate (), '->isUptodate() returns true if the resource has not changed ' );
28
26
$ t ->ok ($ resource ->isUptodate (time () + 10 ), '->isUptodate() returns true if the resource has not changed ' );
29
27
$ t ->ok (!$ resource ->isUptodate (time () - 86400 ), '->isUptodate() returns false if the resource has been updated ' );
30
28
unlink ($ file );
31
29
32
30
$ resource = new FileResource ('/____foo/foobar ' .rand (1 , 999999 ));
33
- $ t ->ok (!$ resource ->isUptodate (), '->isUptodate() returns false if the resource does not exist ' );
31
+ $ t ->ok (!$ resource ->isUptodate (time () ), '->isUptodate() returns false if the resource does not exist ' );
You can’t perform that action at this time.
0 commit comments