Spring supports transactions during tests, but those transactions either roll back or commit only after a test has finished running. So what if we need to commit a transaction during the test? That might be necessary if we’re preparing test fixtures for each test inside tests themselves — not using some global fixtures that all the tests share.
Another common confusion I see in the PHP community is unit testing repositories. Some developers using an ORM like Doctrine mock a query builder and make their mocks expect particular methods calls with particular arguments. Others even try to parse resulting DQL and check it for particular structure. And there are some who go as far as doing the same with the resulting SQL. o_O