The first test does not need to be cleaned up or cleaned up, because the entity manager must detect that the expected changes will not be saved. Therefore, before executing the request, you will not need to clear () and even less clean ().
The second test, however, is different. You execute the update request, and thoses requests completely bypass the first level cache. They make changes to the database behind her. This is why you need to clear it: if you do not, the select query will find a client that is already in the cache, and an object with a cache (but outdated) will be returned.
source share