The Valhalla Core Utils Library expands upon the existing PHP library to include functions to assist with the construction and execution of unit and integration tests.
Here is a list of each of the available functions in Collection and how they can be used. Note that each of these functions is static and therefore can be called without instantiating any objects.
which can be invoked via
This function accepts a class name and method name and allows you to make the method temporarily public to make the testing of protected and private methods easier.
# Taken from one of our unit tests
$method = TestUtil::publicizeMethod('Valhalla\CoreUtilities\Security\CsrfToken', 'generateToken');
$token = new CsrfToken();
$actual = $method->invokeArgs($token, array());