Commit e7551d5
committed
minor symfony#61101 [FrameworkBundle] Fix cache warmers tests (MatTheCat)
This PR was merged into the 7.3 branch.
Discussion
----------
[FrameworkBundle] Fix cache warmers tests
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | N/A
| License | MIT
While updating tests for symfony#60568 I saw `SerializerCacheWarmerTest` and `ValidatorCacheWarmerTest`’s `testWarmUpWithoutBuilDir` fail. Since there will be no warm up without a build directory it was weird a cache item could get hit in that case.
Turns out that was because the `PhpArrayAdapter`’s `$valuesCache` would retain them from previous tests.
This PR adds a `getArrayPool` method to the test cases which allows them to clear it on tearDown, so that tests don’t impact each other. Alternatively they could clear their own adapter or pass it different files, but this seemed the safest approach to me.
Commits
-------
fb9e64e [FrameworkBundle] Fix cache warmers testsFile tree
2 files changed
+45
-11
lines changed- src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer
2 files changed
+45
-11
lines changedLines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
24 | 41 | | |
25 | 42 | | |
26 | 43 | | |
| |||
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
37 | | - | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
56 | 73 | | |
57 | 74 | | |
58 | 75 | | |
59 | | - | |
| 76 | + | |
60 | 77 | | |
61 | 78 | | |
62 | 79 | | |
| |||
75 | 92 | | |
76 | 93 | | |
77 | 94 | | |
78 | | - | |
| 95 | + | |
79 | 96 | | |
80 | | - | |
81 | | - | |
| 97 | + | |
| 98 | + | |
82 | 99 | | |
83 | 100 | | |
84 | 101 | | |
| |||
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
23 | 40 | | |
24 | 41 | | |
25 | 42 | | |
| |||
36 | 53 | | |
37 | 54 | | |
38 | 55 | | |
39 | | - | |
| 56 | + | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
| |||
61 | 78 | | |
62 | 79 | | |
63 | 80 | | |
64 | | - | |
| 81 | + | |
65 | 82 | | |
66 | 83 | | |
67 | 84 | | |
| |||
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
86 | | - | |
| 103 | + | |
87 | 104 | | |
88 | | - | |
89 | | - | |
| 105 | + | |
| 106 | + | |
90 | 107 | | |
91 | 108 | | |
92 | 109 | | |
| |||
103 | 120 | | |
104 | 121 | | |
105 | 122 | | |
106 | | - | |
| 123 | + | |
107 | 124 | | |
108 | 125 | | |
109 | 126 | | |
| |||
0 commit comments