As per the parent issue.
./Cache/AssertPageCacheContextsAndTagsTrait.php
./Cache/CacheTestBase.php
./Cache/GenericCacheBackendUnitTestBase.php
./Cache/PageCacheTagsTestBase.php
./Cache/SessionExistsCacheContextTest.php
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | interdiff-2863318-19-24.txt | 638 bytes | martin107 |
| #24 | see-2863318-24.patch | 21.65 KB | martin107 |
| #19 | interdiff-2863318-16-19.txt | 731 bytes | naveenvalecha |
| #19 | 2863318-19.patch | 15.33 KB | naveenvalecha |
Comments
Comment #2
jofitzMoved 2 files.
Corrected namespace.
Updated references.
Left the 3 previously-deprecated *TestBase.php files for BC purposes.
Comment #4
martin107 commentedlooks like we need to refactor
assertSessionCookieOnClient::assertSessionCookieOnClient()
to use
$this->assertSession()->cookieEquals() to check for the presence of the session name?
[Just feeling my way forward here.]
Comment #5
dawehner@Jo Fitzgerald
Also note: For backward compatibility reasons we have to leave the traits and base classes around there as well. Instead copy them into the right directory.
Comment #6
michielnugter commentedComment #7
martin107 commentedSimple reroll, due to recent changes in TrackerTest.php
Comment #9
martin107 commentedless errors.
Comment #11
dawehnerDoes that mean we should move/copy over the trait here?
Comment #12
martin107 commentedI am thinking of doing something potentially controversial, so it is worth talking about it first
From the perspective of
https://events.drupal.org/baltimore2017/sessions/backwards-compatibility...
We are marking @depreciated several implied public APIs in our base classes.
./Cache/CacheTestBase.php
./Cache/GenericCacheBackendUnitTestBase.php
./Cache/PageCacheTagsTestBase.php
I want to go the extra step and mark the replacement base classes as @internal so that we can
signal that we are dropping long term legacy support for those public APIs.
I am happy to write the change record that come with this....
but hey if anyone objects please let me know.
Comment #13
dawehnerTotally +1 for that. Sharing that kind of code outside of core has a really limited usecase. I like this thinking.
Comment #14
lendudeThis deprecates the WebTestBase AssertPageCacheContextsAndTagsTrait, it only updates the BrowserTestBase tests to use the new version and leaves the old deprecated version on the WebTestBase tests.
While I'm all for #12, starting to implement that here sounds a bit off. It's something we need to do for all converted test bases then. So I'd be all for opening an issue where we @internal all BrowserTestBase TestBase classes. And then from that point on, we do it for all new conversions when appropriate.
Comment #16
naveenvalechaHere we go with fixes. It will un-postpone few issues in the queue.
Comment #18
naveenvalechaWe couldn't trigger error right now, b/c Webtestbase is using WTB AssertPageCacheContextsAndTagsTrait. So the interim solution is to remove the trigger_error for now.
//Naveen
Comment #19
naveenvalechaRemoved the deprecation trigger_error for now
//Naveen
Comment #20
lendudeRemoving the trigger_error for now until we have a good way to handle them in our tests sounds like a good way to keep this moving. Adding the trigger_error later is easily done.
The rest looks nice and minimal.
Applied the patch to check all the moves and remaining files in core/modules/system/src/Tests/Cache. Everything in that folder is now @deprecated so this patch covers the correct scope.
Comment #21
wim leers<3
This is SO much simpler! I wrote that original code and hated it, but that's what was necessary.
Comment #22
gábor hojtsyLooks good other than:
Should have a @see to a change notice according to current guidelines :)
Comment #23
lendudeAdded a change notice, https://www.drupal.org/node/2896632. Still needs a @see in the patch
Comment #24
martin107 commentedadded @see
Comment #25
lendude@martin107 thanks!
Comment #27
catchCommitted/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!
Comment #30
quietone commentedpublished the change record