Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294476

\Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait::assertCacheContexts() is unhelpful after conversion to phpunit

$
0
0

Problem/Motivation

Making this a bug in the test helper trait as it is pretty useless like this now as phpunit fails on the first message:

this part:

    if (!$match) {
      debug('Unwanted cache contexts in response: ' . implode(',', array_diff($actual_contexts, $expected_contexts)));
      debug('Missing cache contexts in response: ' . implode(',', array_diff($expected_contexts, $actual_contexts)));
    }

    $this->assertIdentical($actual_contexts, $expected_contexts, $message);

The problem is that phpunit fails on the first error, which includes debug messages, and especially if the problem is *missing* cache contexts, then you only see the first useless message.

Proposed resolution

Just drop that debug stuff, phpunit shows a nice diff in case of assertIdentical() mismatches.

While we're at it, we should however also revert expected/actual so that the diff order makes sense.

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 294476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>