You are asking doctrine to
findOneBy those criteria inside the database. In your case it returns null but it could as well return a record if there would be such a user
firstName = 'Michael' AND lastName = 'Jordan' inside your database.
The result of this
query has nothing to do with your newly created user.
If it would return the user from the
EntityManager then you would not know whether it is from the database or from memory.