Skip to content

Commit 0fa427c

Browse files
committed
add some comments about the usage of the bundle
1 parent fc1b7c3 commit 0fa427c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/AppKernel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

tests/AppBundle/Controller/Admin/BlogControllerTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)