Replaced php logic with phpunit logic for assertions