8000 minor #52111 [HttpKernel] Fix CacheWarmerAggregateTest (alexandre-dau… · symfony/http-kernel@2caeb02 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2caeb02

Browse files
minor #52111 [HttpKernel] Fix CacheWarmerAggregateTest (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [HttpKernel] Fix CacheWarmerAggregateTest | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT symfony/symfony#50391 seems to bring broken tests. Particularly, the `testWarmupOnOptionalWarmerPassBuildDir` test doesn't seem relevant given the actual code of `CacheWarmerAggregate`. Indeed, nothing in the code is setting `buildDir` to null when using an optional warmer. I suggest a changes to fix this test on 6.4. Also for the first one, given `optionalsEnabled` is enabled, `isOptional` is never called. I suggest to remove this expectation. Commits ------- 945d5cd5e1 [HttpKernel] Fix CacheWarmerAggregateTest
2 parents 19af005 + 7bc11b6 commit 2caeb02

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Tests/CacheWarmer/CacheWarmerAggregateTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ public function testWarmupChecksInvalidFiles()
9696
public function testWarmupPassBuildDir()
9797
{
9898
$warmer = $this->createMock(CacheWarmerInterface::class);
99-
$warmer
100-
->expects($this->once())
101-
->method('isOptional')
102-
->willReturn(false);
10399
$warmer
104100
->expects($this->once())
105101
->method('warmUp')
@@ -110,7 +106,7 @@ public function testWarmupPassBuildDir()
110106
$aggregate->warmUp('cache_dir', 'build_dir');
111107
}
112108

113-
public function testWarmupOnOptionalWarmerDoNotPassBuildDir()
109+
public function testWarmupOnOptionalWarmerPassBuildDir()
114110
{
115111
$warmer = $this->createMock(CacheWarmerInterface::class);
116112
$warmer
@@ -120,10 +116,10 @@ public function testWarmupOnOptionalWarmerDoNotPassBuildDir()
120116
$warmer
121117
->expects($this->once())
122118
->method('warmUp')
123-
->with('cache_dir', null);
119+
->with('cache_dir', 'build_dir');
124120

125121
$aggregate = new CacheWarmerAggregate([$warmer]);
126-
$aggregate->enableOptionalWarmers();
122+
$aggregate->enableOnlyOptionalWarmers();
127123
$aggregate->warmUp('cache_dir', 'build_dir');
128124
}
129125

0 commit comments

Comments
 (0)
0