public function testRemoveProject_ProjectHasMembers_UserRefsToProjectAreRemoved()
 {
     $environ = new MongoTestEnvironment();
     $environ->clean();
     $userId = $environ->createUser('user1', 'user1', 'user1');
     $user = new UserModel($userId);
     $project = $environ->createProject('testProject', 'testProjCode');
     $project->addUser($userId, ProjectRoles::CONTRIBUTOR);
     $projectId = $project->write();
     $user->addProject($project->id->asString());
     $user->write();
     // delete the project
     $project->remove();
     // re-read the user
     $user->read($userId);
     $this->assertFalse($user->isMemberOfProject($projectId));
 }