File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -166,19 +166,20 @@ public function getTagsHeader()
166166 /**
167167 * Invalidate a path or URL
168168 *
169- * @param string $path Path or URL
169+ * @param string $path Path or URL
170+ * @param array $headers HTTP headers (optional)
170171 *
171172 * @throws UnsupportedProxyOperationException
172173 *
173174 * @return $this
174175 */
175- public function invalidatePath ($ path )
176+ public function invalidatePath ($ path, array $ headers = array () )
176177 {
177178 if (!$ this ->cache instanceof PurgeInterface) {
178179 throw UnsupportedProxyOperationException::cacheDoesNotImplement ('PURGE ' );
179180 }
180181
181- $ this ->cache ->purge ($ path );
182+ $ this ->cache ->purge ($ path, $ headers );
182183
183184 return $ this ;
184185 }
Original file line number Diff line number Diff line change @@ -60,14 +60,16 @@ public function testSupportsInvalid()
6060 public function testInvalidatePath ()
6161 {
6262 $ purge = \Mockery::mock ('\FOS\HttpCache\ProxyClient\Invalidation\PurgeInterface ' )
63- ->shouldReceive ('purge ' )->once ()->with ('/my/route ' )
63+ ->shouldReceive ('purge ' )->once ()->with ('/my/route ' , array ())
64+ ->shouldReceive ('purge ' )->once ()->with ('/my/route ' , array ('X-Test-Header ' => 'xyz ' ))
6465 ->shouldReceive ('flush ' )->once ()
6566 ->getMock ();
6667
6768 $ cacheInvalidator = new CacheInvalidator ($ purge );
6869
6970 $ cacheInvalidator
7071 ->invalidatePath ('/my/route ' )
72+ ->invalidatePath ('/my/route ' , array ('X-Test-Header ' => 'xyz ' ))
7173 ->flush ()
7274 ;
7375 }
You can’t perform that action at this time.
0 commit comments