Add PHPUnit tests, merge sonata