Problem/Motivation
Discovered in #3042715: Drupal 9 Deprecated Code Report.
1) Drupal\Tests\votingapi_tokens\Kernel\VoteTokenTest::testVoteTokens
Drupal\Core\Entity\EntityStorageException: The "path_alias" entity type does not exist.
Proposed resolution
Removing the path_alias integration. The votingapi_tokens submodule does not need to test path aliases.
- if (\Drupal::entityTypeManager()->hasDefinition('path_alias')) {
- $this->installEntitySchema('path_alias');
- }
\Drupal::service('router.builder')->rebuild();
$this->installConfig(['system']);
@@ -71,7 +68,6 @@ class VoteTokenTest extends KernelTestBase {
'type' => 'page',
'title' => 'Source Title',
'revision_log' => $this->randomMachineName(),
- 'path' => ['alias' => '/content/source-node'],
]);
Comments
Comment #2
krzysztof domański1. Test only has the deprecated code removed. You can see the problem more easily.
2. The test on D9 (3143178-2.patch) failed due to deprecated code #3042715: Drupal 9 Deprecated Code Report.
Comment #3
andralex commentedTested locally on D9 with both patches applied. All the tests are passed now.
Comment #4
tr commentedProbably don't need 'path' here either. And certainly don't need 'field' twice ... What about 'filter' and 'text'? Might as well clean this up while path is being removed.
Comment #5
krzysztof domański@TR Good point! Let's clearing that separately after removing deprecated code. It will be easier to test. Now we need to merge several patches to test Drupal 9. See #3. I created follow-up #3143358: Remove unnecessary test modules from VoteTokenTest.
Comment #6
tr commentedYeah, that's why I opened #3138493: Plan for Drupal 9 - the deprecations should have been handled first, exactly for this reason. I've been trying to make that happen for four weeks now ... we didn't even have testing turned on back then, and didn't have any working tests, so we've come a long way in those four weeks but the deprecations are still blocking other work like this.
We need the deprecation issue committed, THEN we need to turn on automated testing for D9, THEN we can start addressing any test failures in D9.
Comment #7
tr commentedDeprecations have been committed and testing has been turned on for D9
I retested the patch 3143178-2.patch in #2 and as you can see Voting API now passes all tests in D9!
RTBC.
Comment #9
pifagor commented