replaced example with PHPUnit tests, refactored Entity