Add resource calls and set tests to use phpunit