File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -89,3 +89,39 @@ class AppKernel extends TestKernel
89
89
90
90
}
91
91
````
92
+
93
+ Performing functional tests
94
+ ---------------------------
95
+
96
+ The testing component provides a base test class which makes it easy
97
+ to load DataFixtures and access different types of object managers.
98
+
99
+
100
+ ```` php
101
+ <?php
102
+
103
+ namespace Symfony\Cmf\Bundle\MenuBundle\Tests\Functional\Admin\MenuNodeAdminTest;
104
+
105
+ use Symfony\Cmf\Component\Testing\Functional\BaseTestCase;
106
+
107
+ class MenuNodeAdminTest extends BaseTestCase
108
+ {
109
+ public function setUp()
110
+ {
111
+ $this->db('PHPCR')->loadFixtures(array(
112
+ 'Symfony\Cmf\Bundle\MenuBundle\Tests\Functional\DataFixtures\PHPCR\LoadMenuData',
113
+ ));
114
+ $this->client = $this->createClient();
115
+ }
116
+
117
+ public function testDashboard()
118
+ {
119
+ $crawler = $this->client->request('GET', '/admin/dashboard');
120
+ $res = $this->client->getResponse();
121
+ $this->assertEquals(200, $res->getStatusCode());
122
+ $this->assertCount(1, $crawler->filter('html:contains("dashboard.label_menu_node")'));
123
+
124
+ $this->db('PHPCR')->getOm(); // get the document/entity (or object) manager
125
+ }
126
+ }
127
+ ````
You can’t perform that action at this time.
0 commit comments