- Issue created by @xjm
Followup from π The entity link label formatter should check URL access RTBC . As I said on that issue:
1) Drupal\Tests\field\Kernel\EntityReference\EntityReferenceFormatterTest::testLabelFormatter Undefined array key "#plain_text" /builds/issue/drupal-3386313/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php:426 /builds/issue/drupal-3386313/vendor/phpunit/phpunit/src/Framework/TestResult.php:729 ERRORS! Tests: 8, Assertions: 76, Errors: 1. PHPUnit 9.6.23 by Sebastian Bergmann and contributors.
That's... not exactly the fail I was expecting, and it also demonstrates that the custom assertion message is not useful because it will never be displayed since it fails on an undefined array key rather than the actual assertion. It would probably be better to assert the existence of it first, I think, since (upon careful review), that is what is being added.
Wherever possible, tests should fail assertions explicitly, not fail because of PHP runtime errors.
Revert 85dc67bf
on 11.x (or 302eef63
on 10.6.x if the former does not revert cleanly) and run EntityReferenceFormatterTest::testLabelFormatter()
.
Improve the test to have better assertions and fail more explicitly. Some docs wouldn't hurt, either.
TBD
N/A
None.
Better not be any.
None.
N/A
Active
11.0 π₯
entity system