Changed the logic for testing with phpunit