Begin moving query building tests into phpunit