by Elnur Abdurrakhimov

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…

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…

When using Assetic or the asset function to output assets in Symfony, you get something like the following in the HTML output: <link href="/css/style.css" rel="stylesheet"/> Unless you disable caching on the web server level, this CSS file will get cached the first time it's…

One of the first things developers new to the Symfony framework learn about is bundles. Everything in Symfony is a bundle, the documentation says. Based on that thought enthusiastic developers happily hop the bundle bandwagon and start creating a bunch of bundles in their apps: CommonBundle CoreBundle UserBundle FrontendBundle BackendBundle…

If for some reason you want to disable HTML5 form validation globally by changing something in one place only, here's one way you could do it: Another way would be to add a custom form theme and override the form_start block, but using an extension feels like a better…