|
5 | 5 | namespace Drupal\KernelTests\Components;
|
6 | 6 |
|
7 | 7 | use Drupal\Core\Render\Component\Exception\ComponentNotFoundException;
|
8 |
| -use Drupal\Core\Cache\CacheBackendInterface; |
9 | 8 |
|
10 | 9 | /**
|
11 | 10 | * Tests the component plugin manager.
|
@@ -50,47 +49,4 @@ public function testMismatchingFolderName(): void {
|
50 | 49 | $this->manager->find('sdc_theme_test:mismatching-folder-name');
|
51 | 50 | }
|
52 | 51 |
|
53 |
| - /** |
54 |
| - * Test component definitions caching depending on twig debug/cache settings. |
55 |
| - * |
56 |
| - * @param bool $twigDebug |
57 |
| - * Whether twig debug is enabled. |
58 |
| - * @param bool $cacheEnabled |
59 |
| - * Whether cache is enabled. |
60 |
| - * @param bool $expectCacheGet |
61 |
| - * Whether we expect the cache to be called. |
62 |
| - * |
63 |
| - * @dataProvider providerTestComponentCachingDependingOnDevelopmentSettings |
64 |
| - */ |
65 |
| - public function testComponentCachingDependingOnDevelopmentSettings(bool $twigDebug, bool $cacheEnabled, bool $expectCacheGet): void { |
66 |
| - // Set the development settings. |
67 |
| - $developmentSettings = $this->keyValue->get('development_settings'); |
68 |
| - $developmentSettings->set('twig_debug', $twigDebug); |
69 |
| - $developmentSettings->set('twig_cache_disable', !$cacheEnabled); |
70 |
| - |
71 |
| - // Set the cache backend as a spy mock. |
72 |
| - $cacheBackend = $this->createMock(CacheBackendInterface::class); |
73 |
| - $cacheBackend->expects($expectCacheGet ? $this->once() : $this->never()) |
74 |
| - ->method('get') |
75 |
| - ->with('cache_key'); |
76 |
| - $this->manager->setCacheBackend($cacheBackend, 'cache_key'); |
77 |
| - |
78 |
| - // Make two calls to getDefinitions() to ensure the |
79 |
| - // cache is/isn't called if it should/shouldn't be. |
80 |
| - $this->manager->getDefinitions(); |
81 |
| - $this->manager->getDefinitions(); |
82 |
| - } |
83 |
| - |
84 |
| - /** |
85 |
| - * Data provider for testComponentCachingDependingOnDevelopmentSettings(). |
86 |
| - */ |
87 |
| - public static function providerTestComponentCachingDependingOnDevelopmentSettings(): array { |
88 |
| - return [ |
89 |
| - 'Debug enabled, cache enabled' => [TRUE, TRUE, FALSE], |
90 |
| - 'Debug enabled, cache disabled' => [TRUE, FALSE, FALSE], |
91 |
| - 'Debug disabled, cache enabled' => [FALSE, TRUE, TRUE], |
92 |
| - 'Debug disabled, cache disabled' => [FALSE, FALSE, FALSE], |
93 |
| - ]; |
94 |
| - } |
95 |
| - |
96 | 52 | }
|
0 commit comments