Unit testing Elgg / php

Hello
I want to set up unit tests for a plugin that I developed on Elgg but I do not really know where to start.
If other people have already put in place, they could advise me.
Is there a plugin that would implement these tests (and documenattion course), if not how to testboth the php code and functions Elgg which obviously are not recognized as a tool phpunit.

Thank you in advance for your help