Php unit tests

A pile of unit tests.