Problem/Motivation

We copied some of Doctrine's tests for DocParser and SimpleAnnotationReader to our codebase as part of #2631202: Doctrine no longer supports SimpleAnnotationReader, incorporate a solution into core but we forgot to update the use statements so we're still testing Doctrine's code and not ours.

Proposed resolution

  • Update the use statements
  • Remove tests of non-copied code
  • Fix tests so static caches don't interfere with running all the tests by doing ./vendor/bin/phpunit -v -c ./core core/tests/Drupal/Tests/Component/Annotation

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3089530-2.patch3.25 KBalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +PHP 7.4
StatusFileSize
new3.25 KB

This was discovered as part of #3086374: Make Drupal 8 & 9 compatible with PHP 7.4 where we fixed deprecations in our own DocParser but the tests were still triggering them (because they are using Doctrines).

Also fixing the ability to run all the Annotation tests together. Some of our existing tests have static caches that break tests.

alexpott’s picture

+++ b/core/tests/Drupal/Tests/Component/Annotation/Doctrine/Ticket/DCOM58Test.php
@@ -28,18 +27,6 @@ public function setUp()
-        $reader     = new AnnotationReader();
-        $result     = $reader->getClassAnnotations(new \ReflectionClass(__NAMESPACE__."\MappedClass"));

We've not copied the AnnotationReader so we don't need this test.

tedbow’s picture

Status: Needs review » Reviewed & tested by the community

Whoops, sorry about that.

The changes look good

+++ b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryCachedTest.php
@@ -9,6 +9,7 @@
+ * @runTestsInSeparateProcesses

+++ b/core/tests/Drupal/Tests/Component/Annotation/AnnotatedClassDiscoveryTest.php
@@ -10,6 +10,7 @@
+ * @runTestsInSeparateProcesses

Confirm that without these you can't run

./vendor/bin/phpunit -v -c ./core core/tests/Drupal/Tests/Component/Annotation

  • catch committed 7110eab on 9.0.x
    Issue #3089530 by alexpott: Tests of copied Doctrine code are not...

  • catch committed cb3e257 on 8.9.x
    Issue #3089530 by alexpott: Tests of copied Doctrine code are not...

  • catch committed 8a2b158 on 8.8.x
    Issue #3089530 by alexpott: Tests of copied Doctrine code are not...
catch’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 7110eab and pushed to 9.0.x, cherry-picked back to 8.8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.