Skip to content

Commit 94cef15

Browse files
committed
minor #10026 Mention the DoctrineTestBundle for tests that interact with the database (javiereguiluz)
This PR was merged into the 2.8 branch. Discussion ---------- Mention the DoctrineTestBundle for tests that interact with the database This fixes #9954. Commits ------- 219f617 Mention the DoctrineTestBundle for tests that interact with the database
2 parents 23b5b8d + 219f617 commit 94cef15

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

testing/database.rst

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ your test always has the same data to work with.
1515

1616
If you want to test your queries directly, see :doc:`/testing/doctrine`.
1717

18+
.. tip::
19+
20+
A popular technique to improve the performance of tests that interact with
21+
the database is to begin a transaction before every test and roll it back
22+
after the test has finished. This makes it unnecessary to recreate the
23+
database or reload fixtures before every test. A community bundle called
24+
`DoctrineTestBundle`_ provides this feature.
25+
1826
Mocking the ``Repository`` in a Unit Test
1927
-----------------------------------------
2028

@@ -150,3 +158,5 @@ configuration:
150158
151159
Make sure that your database runs on localhost and has the defined database and
152160
user credentials set up.
161+
162+
.. _`DoctrineTestBundle`: https://github.com/dmaicher/doctrine-test-bundle

0 commit comments

Comments
 (0)