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:
Attachment | Size | Status | Test result | Operations |
---|---|---|---|---|
d8.protected-test-methods.patch | 1.97 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 52,317 pass(es). | View details | Re-test |