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