| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace App\Tests\Functional\Controller; |
|
| 4 | ||
| 5 | class AdminHistoryControllerTest extends AbstractAdminController |
|
| 6 | { |
|
| 7 | public function testHistoryListAction() |
|
| 8 | { |
|
| 9 | $this->request('/admin/History/list', 'GET', 302); |
|
| 10 | ||
| 11 | $this->logIn(); |
|
| 12 | ||
| 13 | $this->request('/admin/History/list', 'GET', 200); |
|
| 14 | $this->assertAdminListPageHasColumns(['Main Picture', 'Year', 'Title', 'Action', 'Type']); |
|
| 15 | } |
|
| 16 | ||
| 17 | public function testHistoryCreateAction() |
|
| 18 | { |
|
| 19 | $this->request('/admin/History/create', 'GET', 302); |
|
| 20 | ||
| 21 | $this->logIn(); |
|
| 22 | ||
| 23 | $this->request('/admin/History/create', 'GET', 200); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testHistoryDeleteAction() |
|
| 27 | { |
|
| 28 | $tagsCount1 = count($this->getEm()->getRepository('App:Tag')->findAll()); |
|
| 29 | ||
| 30 | $object = $this->getEm()->getRepository('App:History')->findOneBy([]); |
|
| 31 | $this->processDeleteAction($object); |
|
| 32 | ||
| 33 | $tagsCount2 = count($this->getEm()->getRepository('App:Tag')->findAll()); |
|
| 34 | $this->assertEquals($tagsCount2, $tagsCount1); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||
| @@ 5-36 (lines=32) @@ | ||
| 2 | ||
| 3 | namespace App\Tests\Functional\Controller; |
|
| 4 | ||
| 5 | class AdminPostControllerTest extends AbstractAdminController |
|
| 6 | { |
|
| 7 | public function testPostListAction() |
|
| 8 | { |
|
| 9 | $this->request('/admin/Post/list', 'GET', 302); |
|
| 10 | ||
| 11 | $this->logIn(); |
|
| 12 | ||
| 13 | $this->request('/admin/Post/list', 'GET', 200); |
|
| 14 | $this->assertAdminListPageHasColumns(['Main Picture', 'Title', 'Created At', 'Action']); |
|
| 15 | } |
|
| 16 | ||
| 17 | public function testPostCreateAction() |
|
| 18 | { |
|
| 19 | $this->request('/admin/Post/create', 'GET', 302); |
|
| 20 | ||
| 21 | $this->logIn(); |
|
| 22 | ||
| 23 | $this->request('/admin/Post/create', 'GET', 200); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testPostDeleteAction() |
|
| 27 | { |
|
| 28 | $tagsCount1 = count($this->getEm()->getRepository('App:Tag')->findAll()); |
|
| 29 | ||
| 30 | $object = $this->getEm()->getRepository('App:Post')->findOneBy([]); |
|
| 31 | $this->processDeleteAction($object); |
|
| 32 | ||
| 33 | $tagsCount2 = count($this->getEm()->getRepository('App:Tag')->findAll()); |
|
| 34 | $this->assertEquals($tagsCount2, $tagsCount1); |
|
| 35 | } |
|
| 36 | } |
|
| 37 | ||