testable code with phpunit

Change-Id: I691f27af95cd287f6ca561ea12656a0a00afc8b4