Problem/Motivation

This issue #2350551: Views fields that have attached assets are lost when Views output caching is enabled introduced a bug into unit test @cover annotations.

+++ b/core/tests/Drupal/Tests/Core/Render/BubbleableMetadataTest.php
@@ -0,0 +1,117 @@
+/**
+ * @coversDefaultClass \Drupal\Core\Render\BubbleableMetadata
+ * @group Render
+ */
+class BubbleableMetadataTest extends UnitTestCase {
+
+  /**
+   * @covers ::apply
+   * @dataProvider providerTestApply
+   */
+  public function testApply(BubbleableMetadata $metadata, array $render_array, array $expected) {

There's no such method as BubbleableMetadata::apply(), so the @cover annotation is incorrect and I can't make a coverage report.

Proposed resolution

Fix the annotation.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#2 2413941_1.patch1.1 KBmile23

Comments

mile23’s picture

Issue summary: View changes
mile23’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

How about a patch?

wim leers’s picture

Component: views.module » base system
Status: Needs review » Reviewed & tested by the community
Issue tags: +Quickfix

Thanks for catching that, and fixing it!

I wish PHPUnit always reported problems like this :(

mile23’s picture

Yeah, wouldn't that be great? #2415441: Automate finding @covers errors

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Test only changes are not subject to beta evaluation. Committed 180add7 and pushed to 8.0.x. Thanks!

  • alexpott committed 180add7 on 8.0.x
    Issue #2413941 by Mile23: BubbleableMetadataTest::testApply has wrong @...

Status: Fixed » Closed (fixed)

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