The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- First commit to issue fork.
- π¦πΊAustralia mstrelan
Rerolled to an MR, snuck in some property and param types and changed one of the public methods to protected. Wonder if this can be a kernel test but not sure it will cover everything that
drupal_flush_all_caches
does. Updated the issue summary with the standard template. - πΊπΈUnited States smustgrave
Seems like a good refactor to me, seems pretty straight forward.
- π¬π§United Kingdom catch
We would normally deprecate test base classes, but for me there's a grey area when modules have them because they're never really supposed to be used outside that module. However, I think it would be good to check in gitlab project search or the contrib grepping site whether there's any modules out there using this before we remove it.
- π¦πΊAustralia mstrelan
There are 81 instances of CacheTestBase, but most of them look like clones of Drupal core.
Excluding the path
core/modules/system
there is 1 instance and that is not a code reference but some kind of git log reference. Going to self-restore to RTBC based on this. - π¬π§United Kingdom catch
Thanks for checking.
Looking at the test now, I don't think it should exist at all, it's a functional test that makes no http requests, looks like it was added in 2012 which when a lot of early test coverage was, and we didn't have real unit tests or kernel tests.
Not sure we need any of this coverage, but we could maybe set a couple of cache items then check they're not there afterrwards in DrupalFlushAllCachesTest?
- π¦πΊAustralia mstrelan
Some other classes that previously extended
CacheTestBase
were replaced in #1637478: Add a PHP array cache backend β , not sure whyClearTest
wasn't replaced at the same time. We also have\Drupal\KernelTests\Core\Cache\GenericCacheBackendUnitTestBase::testDeleteAll
but that doesn't necessarily coverdrupal_flush_all_caches
.DrupalFlushAllCachesTest
has the@covers ::drupal_flush_all_caches
annotation, so that's a good start. But it seems to only be testing that container.modules is updated.Not sure we need any of this coverage, but we could maybe set a couple of cache items then check they're not there afterrwards in DrupalFlushAllCachesTest?
Yeah we could just move
ClearTest::testFlushAllCaches
in toDrupalFlushAllCachesTest
. Probably that class should test everything that function does, like deleting asset files, twig caches etc. I guess those are all tested independently so it might be hard to find something useful to test.Unrelated to this issue, but this line in
DrupalFlushAllCachesTest
is useless now since that function has moved to OOP hooks.
$this->assertFalse(function_exists('system_test_help'));