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

Add methods for testing protected class methods and properties in DrupalUnitTestBase.

$
0
0

I have thought about this for a while, and also used similar things before to test protected properties and method on classes. The only other way to really do this is to create a wrapper class that extends the class you want to test OR just rely on the methods being implicitly tested from other methods.

We could add some helper methods for doing this, so we can just test protected 'things'.

Issues such as #1929214: All methods in EntityListController that are not in EntityListControllerInterface must be protected could benefit from this.

So, I was thinking something like this:

AttachmentSizeStatusTest resultOperations
d8.protected-test-methods.patch1.97 KBIdlePASSED: [[SimpleTest]]: [MySQL] 52,317 pass(es).View details | Re-test

Viewing all articles
Browse latest Browse all 292273

Trending Articles



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