Also add some phpunit tests for this class, but there are some problems yet with mocking static functions.