File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed
Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 2121 "phpspec/phpspec" : " ^5.1.2" ,
2222 "ezsystems/ezplatform-code-style" : " ^0.1.0" ,
2323 "friendsofphp/php-cs-fixer" : " ^2.16.1" ,
24- "memio/spec-gen" : " ^0.9.0"
24+ "memio/spec-gen" : " ^0.9.0" ,
25+ "symfony/phpunit-bridge" : " ^5.1"
2526 },
2627 "autoload" : {
2728 "psr-4" : {
Original file line number Diff line number Diff line change 99 >
1010 <php >
1111 <ini name =" error_reporting" value =" -1" />
12+ <env name =" SYMFONY_DEPRECATIONS_HELPER" value =" disabled=1" />
1213 </php >
1314 <testsuites >
1415 <testsuite name =" default" ><directory >tests</directory ></testsuite >
1516 </testsuites >
17+ <listeners >
18+ <listener class =" \Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
19+ </listeners >
1620</phpunit >
Original file line number Diff line number Diff line change 44 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
55 * @license For full copyright and license information view LICENSE file distributed with this source code.
66 */
7- namespace EzSystems \PlatformHttpCacheBundle \Tests \PurgeClient ;
8-
9- /**
10- * Avoid test failure caused by time passing between generating expected & actual object.
11- *
12- * @return int
13- */
14- function time ()
15- {
16- return 1417624982 ;
17- }
18-
197namespace eZ \Publish \Core \MVC \Symfony \Cache \Tests ;
208
219use EzSystems \PlatformHttpCacheBundle \RequestAwarePurger ;
2210use EzSystems \PlatformHttpCacheBundle \PurgeClient \LocalPurgeClient ;
2311use PHPUnit \Framework \TestCase ;
2412use Symfony \Component \HttpFoundation \Request ;
13+ use Symfony \Bridge \PhpUnit \ClockMock ;
2514
2615class LocalPurgeClientTest extends TestCase
2716{
17+ /**
18+ * @group time-sensitive
19+ */
2820 public function testPurge ()
2921 {
22+ ClockMock::register (Request::class);
23+
3024 $ locationIds = [123 , 456 , 789 ];
3125 $ expectedBanRequest = Request::create ('http://localhost ' , 'PURGE ' );
3226 $ expectedBanRequest ->headers ->set ('key ' , 'l123 l456 l789 ' );
You can’t perform that action at this time.
0 commit comments