| @@ 14-55 (lines=42) @@ | ||
| 11 | ||
| 12 | use AppBundle\Tests\TestBaseWeb; |
|
| 13 | ||
| 14 | class CategoryControllerTest extends TestBaseWeb |
|
| 15 | { |
|
| 16 | public function testCreateCategory() |
|
| 17 | { |
|
| 18 | $client = static::createClient(array(), array( |
|
| 19 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 20 | 'PHP_AUTH_PW' => 'user', |
|
| 21 | )); |
|
| 22 | $client->request('GET', '/admin/category/new'); |
|
| 23 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testEditCategory() |
|
| 27 | { |
|
| 28 | $client = static::createClient(array(), array( |
|
| 29 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 30 | 'PHP_AUTH_PW' => 'user', |
|
| 31 | )); |
|
| 32 | $client->request('GET', '/admin/category/edit/1'); |
|
| 33 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testRemoveCategory() |
|
| 37 | { |
|
| 38 | $client = static::createClient(array(), array( |
|
| 39 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 40 | 'PHP_AUTH_PW' => 'user', |
|
| 41 | )); |
|
| 42 | $client->request('DELETE', '/admin/category/remove/1'); |
|
| 43 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testShowCategory() |
|
| 47 | { |
|
| 48 | $client = static::createClient(array(), array( |
|
| 49 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 50 | 'PHP_AUTH_PW' => 'user', |
|
| 51 | )); |
|
| 52 | $client->request('GET', '/admin/category'); |
|
| 53 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| @@ 14-55 (lines=42) @@ | ||
| 11 | ||
| 12 | use AppBundle\Tests\TestBaseWeb; |
|
| 13 | ||
| 14 | class ModuleControllerTest extends TestBaseWeb |
|
| 15 | { |
|
| 16 | public function testCreateModule() |
|
| 17 | { |
|
| 18 | $client = static::createClient(array(), array( |
|
| 19 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 20 | 'PHP_AUTH_PW' => 'user', |
|
| 21 | )); |
|
| 22 | $client->request('GET', '/admin/module/new'); |
|
| 23 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testEditModule() |
|
| 27 | { |
|
| 28 | $client = static::createClient(array(), array( |
|
| 29 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 30 | 'PHP_AUTH_PW' => 'user', |
|
| 31 | )); |
|
| 32 | $client->request('GET', '/admin/module/edit/1'); |
|
| 33 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testRemoveModule() |
|
| 37 | { |
|
| 38 | $client = static::createClient(array(), array( |
|
| 39 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 40 | 'PHP_AUTH_PW' => 'user', |
|
| 41 | )); |
|
| 42 | $client->request('DELETE', '/admin/module/remove/1'); |
|
| 43 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testShowModule() |
|
| 47 | { |
|
| 48 | $client = static::createClient(array(), array( |
|
| 49 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 50 | 'PHP_AUTH_PW' => 'user', |
|
| 51 | )); |
|
| 52 | $client->request('GET', '/admin/module'); |
|
| 53 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | ||
| @@ 14-55 (lines=42) @@ | ||
| 11 | ||
| 12 | use AppBundle\Tests\TestBaseWeb; |
|
| 13 | ||
| 14 | class QuestionControllerTest extends TestBaseWeb |
|
| 15 | { |
|
| 16 | public function testCreateQuestion() |
|
| 17 | { |
|
| 18 | $client = static::createClient(array(), array( |
|
| 19 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 20 | 'PHP_AUTH_PW' => 'user', |
|
| 21 | )); |
|
| 22 | $client->request('GET', '/admin/question/new/1'); |
|
| 23 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testEditQuestion() |
|
| 27 | { |
|
| 28 | $client = static::createClient(array(), array( |
|
| 29 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 30 | 'PHP_AUTH_PW' => 'user', |
|
| 31 | )); |
|
| 32 | $client->request('GET', '/admin/question/edit/1/1'); |
|
| 33 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function testRemoveQuestion() |
|
| 37 | { |
|
| 38 | $client = static::createClient(array(), array( |
|
| 39 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 40 | 'PHP_AUTH_PW' => 'user', |
|
| 41 | )); |
|
| 42 | $client->request('DELETE', '/admin/question/remove/1/1'); |
|
| 43 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testShowQuestion() |
|
| 47 | { |
|
| 48 | $client = static::createClient(array(), array( |
|
| 49 | 'PHP_AUTH_USER' => '[email protected]', |
|
| 50 | 'PHP_AUTH_PW' => 'user', |
|
| 51 | )); |
|
| 52 | $client->request('GET', '/admin/question/show/1'); |
|
| 53 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||