@@ 9-29 (lines=21) @@ | ||
6 | ||
7 | class SurveyControllerTest extends WebTestCase |
|
8 | { |
|
9 | public function testSurveys() |
|
10 | { |
|
11 | exec('./bin/console d:d:c --env=test'); |
|
12 | exec('./bin/console d:s:c --env=test'); |
|
13 | exec('./bin/console h:f:l -n --env=test'); |
|
14 | ||
15 | $client = static::createClient(); |
|
16 | ||
17 | $crawler = $client->request('GET', '/surveys', array(), array(), array( |
|
18 | 'PHP_AUTH_USER' => '[email protected]', |
|
19 | 'PHP_AUTH_PW' => 'admin', |
|
20 | )); |
|
21 | ||
22 | $form = $crawler->selectButton('Filter')->form(); |
|
23 | $form['survey_filter[type]']->select('1'); |
|
24 | ||
25 | $client->followRedirects(); |
|
26 | $crawler = $client->submit($form); |
|
27 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
28 | $this->assertCount(1, $crawler->filter('ul.survey_item')); |
|
29 | } |
|
30 | ||
31 | public function testSurvey() |
|
32 | { |
@@ 10-26 (lines=17) @@ | ||
7 | ||
8 | class UserControllerTest extends WebTestCase |
|
9 | { |
|
10 | public function testListAction() |
|
11 | { |
|
12 | exec('./bin/console d:d:c --env=test'); |
|
13 | exec('./bin/console d:s:c --env=test'); |
|
14 | exec('./bin/console h:f:l -n --env=test'); |
|
15 | ||
16 | $client = static::createClient(); |
|
17 | $client->request('GET', '/users'); |
|
18 | $this->assertEquals('302', $client->getResponse()->getStatusCode()); |
|
19 | $crawler = $client->request('GET', '/login'); |
|
20 | ||
21 | $form = $crawler->selectButton('Login')->form(); |
|
22 | $client->submit($form, ['_username' => '[email protected]', '_password' => 'admin']); |
|
23 | $client->request('GET', '/users'); |
|
24 | ||
25 | $this->assertEquals('200', $client->getResponse()->getStatusCode()); |
|
26 | } |
|
27 | ||
28 | public function testAddAction() |
|
29 | { |