File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
tests/AppBundle/Controller/Admin Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ public function registerBundles()
3636 $ bundles [] = new Sensio \Bundle \GeneratorBundle \SensioGeneratorBundle ();
3737
3838 if ($ this ->getEnvironment () === 'test ' ) {
39- $ bundles [] = new \DAMA \DoctrineTestBundle \DAMADoctrineTestBundle ();
39+ // this bundle is used to have isolated phpunit tests when interacting with doctrine & the database
40+ // and is therefore only loaded for the 'test' environment
41+ $ bundles [] = new DAMA \DoctrineTestBundle \DAMADoctrineTestBundle ();
4042 }
4143 }
4244
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ public function testAdminBackendHomePage()
7979 );
8080 }
8181
82+ /**
83+ * This test will manipulate the database state by deleting a Post.
84+ * All changes to the database are rolled back before the next test case is executed.
85+ * This is done by using https://github.com/dmaicher/doctrine-test-bundle.
86+ *
87+ * Therefore in the following test case we can edit the Post with ID=1 although we deleted it in this test.
88+ */
8289 public function testAdminDeletePost ()
8390 {
8491 $ client = $ this ->getAdminClient ();
You can’t perform that action at this time.
0 commit comments