File tree 6 files changed +19
-17
lines changed
Resources/doc/reference/configuration
6 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,6 @@ tag ``articles-123`` with the following configuration:
81
81
match :
82
82
path : ^/articles
83
83
tags : [articles]
84
- tag_expressions : ["article-" ~id]
84
+ tag_expressions : ["' article-' ~id" ]
85
85
86
86
You can combine ``tags `` and ``tag_expression `` in one rule.
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public function testIsCached()
19
19
{
20
20
$ client = static ::createClient ();
21
21
22
- $ client ->request ('GET ' , '/cached ' );
22
+ $ client ->request ('GET ' , '/cached/42 ' );
23
23
$ response = $ client ->getResponse ();
24
24
$ this ->assertEquals ('public ' , $ response ->headers ->get ('Cache-Control ' ));
25
25
}
Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ public function testConfigurationTagsAreSet()
63
63
{
64
64
$ client = static ::createClient ();
65
65
66
- $ client ->request ('GET ' , '/cached ' );
66
+ $ client ->request ('GET ' , '/cached/51 ' );
67
67
$ response = $ client ->getResponse ();
68
- $ this ->assertEquals ('area ' , $ response ->headers ->get ('X-Cache-Tags ' ));
68
+ $ this ->assertEquals ('area,area-51 ' , $ response ->headers ->get ('X-Cache-Tags ' ));
69
69
}
70
70
71
71
public function testConfigurationTagsAreInvalidated ()
@@ -76,11 +76,11 @@ public function testConfigurationTagsAreInvalidated()
76
76
'fos_http_cache.cache_manager ' ,
77
77
'\FOS\HttpCacheBundle\CacheManager '
78
78
)
79
- ->shouldReceive ('invalidateTags ' )->once ()->with (array ('area ' ))
79
+ ->shouldReceive ('invalidateTags ' )->once ()->with (array ('area ' , ' area-51 ' ))
80
80
->shouldReceive ('flush ' )->once ()
81
81
;
82
82
83
- $ client ->request ('POST ' , '/cached ' );
83
+ $ client ->request ('PUT ' , '/cached/51 ' );
84
84
}
85
85
86
86
protected function tearDown ()
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ public function errorAction()
47
47
return new Response ('Forbidden ' , 403 );
48
48
}
49
49
50
- public function contentAction ()
50
+ public function contentAction ($ id = null )
51
51
{
52
- return new Response ('content ' );
52
+ return new Response ('content ' . $ id );
53
53
}
54
54
}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ fos_http_cache:
23
23
match :
24
24
path : ^/cached
25
25
tags : [area]
26
+ tag_expressions : ["'area-'~id"]
26
27
user_context :
27
28
user_identifier_headers :
28
29
- Cookie
Original file line number Diff line number Diff line change 1
1
test_list :
2
- pattern : /test/list
3
- defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::listAction }
2
+ pattern : /test/list
3
+ defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::listAction }
4
4
methods : [GET]
5
5
6
6
test_error :
7
- pattern : /test/error
8
- defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::errorAction }
7
+ pattern : /test/error
8
+ defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::errorAction }
9
9
10
10
test_one :
11
- pattern : /test/{id}
12
- defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::itemAction }
11
+ pattern : /test/{id}
12
+ defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::itemAction }
13
13
methods : [GET,POST]
14
14
15
15
test_cached :
16
- pattern : /cached
17
- defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::contentAction }
16
+ pattern : /cached/{id}
17
+ defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::contentAction }
18
+ methods : [GET,PUT]
18
19
19
20
test_noncached :
20
21
pattern : /noncached
21
- defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::contentAction }
22
+ defaults : { _controller: FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller\TestController::contentAction }
22
23
23
24
test_logout :
24
25
pattern : /secured_area/logout
You can’t perform that action at this time.
0 commit comments