@@ 47-66 (lines=20) @@ | ||
44 | ->count()); |
|
45 | } |
|
46 | ||
47 | public function testSurveyCreate() |
|
48 | { |
|
49 | $client = static::createClient(); |
|
50 | ||
51 | $crawler = $client->request('GET', '/surveys/create/internship', array(), array(), array( |
|
52 | 'PHP_AUTH_USER' => '[email protected]', |
|
53 | 'PHP_AUTH_PW' => 'admin', |
|
54 | )); |
|
55 | ||
56 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
57 | ||
58 | $form = $crawler->selectButton('Create survey')->form(); |
|
59 | ||
60 | $form['survey[user]']->select('2'); |
|
61 | ||
62 | $client->followRedirects(); |
|
63 | $client->submit($form); |
|
64 | ||
65 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
66 | } |
|
67 | ||
68 | public function testSurveyDelete() |
|
69 | { |
|
@@ 68-86 (lines=19) @@ | ||
65 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
66 | } |
|
67 | ||
68 | public function testSurveyDelete() |
|
69 | { |
|
70 | $client = static::createClient(); |
|
71 | ||
72 | $crawler = $client->request('GET', '/surveys/delete/1', array(), array(), array( |
|
73 | 'PHP_AUTH_USER' => '[email protected]', |
|
74 | 'PHP_AUTH_PW' => 'admin', |
|
75 | )); |
|
76 | ||
77 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
78 | ||
79 | $form = $crawler->selectButton('Delete survey')->form(); |
|
80 | ||
81 | $client->followRedirects(); |
|
82 | $client->submit($form); |
|
83 | ||
84 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
85 | exec('./bin/console d:d:d --force --env=test'); |
|
86 | } |
|
87 | } |
|
88 |