@@ 249-268 (lines=20) @@ | ||
246 | $this->assertEquals('acme.formatter', (string) $def->getArgument(0)); |
|
247 | } |
|
248 | ||
249 | public function testCachePluginConfigCacheKeyGeneratorReference(): void |
|
250 | { |
|
251 | $this->load([ |
|
252 | 'plugins' => [ |
|
253 | 'cache' => [ |
|
254 | 'cache_pool' => 'my_cache_pool', |
|
255 | 'config' => [ |
|
256 | 'cache_key_generator' => 'header_cache_key_generator', |
|
257 | ], |
|
258 | ], |
|
259 | ], |
|
260 | ]); |
|
261 | ||
262 | $cachePlugin = $this->container->findDefinition('httplug.plugin.cache'); |
|
263 | ||
264 | $config = $cachePlugin->getArgument(2); |
|
265 | $this->assertArrayHasKey('cache_key_generator', $config); |
|
266 | $this->assertInstanceOf(Reference::class, $config['cache_key_generator']); |
|
267 | $this->assertSame('header_cache_key_generator', (string) $config['cache_key_generator']); |
|
268 | } |
|
269 | ||
270 | public function testCachePluginConfigCacheListenersDefinition(): void |
|
271 | { |
|
@@ 270-291 (lines=22) @@ | ||
267 | $this->assertSame('header_cache_key_generator', (string) $config['cache_key_generator']); |
|
268 | } |
|
269 | ||
270 | public function testCachePluginConfigCacheListenersDefinition(): void |
|
271 | { |
|
272 | $this->load([ |
|
273 | 'plugins' => [ |
|
274 | 'cache' => [ |
|
275 | 'cache_pool' => 'my_cache_pool', |
|
276 | 'config' => [ |
|
277 | 'cache_listeners' => [ |
|
278 | 'httplug.plugin.cache.listeners.add_header', |
|
279 | ], |
|
280 | ], |
|
281 | ], |
|
282 | ], |
|
283 | ]); |
|
284 | ||
285 | $cachePlugin = $this->container->findDefinition('httplug.plugin.cache'); |
|
286 | ||
287 | $config = $cachePlugin->getArgument(2); |
|
288 | $this->assertArrayHasKey('cache_listeners', $config); |
|
289 | $this->assertContainsOnlyInstancesOf(Reference::class, $config['cache_listeners']); |
|
290 | $this->assertSame('httplug.plugin.cache.listeners.add_header', (string) $config['cache_listeners'][0]); |
|
291 | } |
|
292 | ||
293 | public function testContentTypePluginAllowedOptions(): void |
|
294 | { |