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.