1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace App\Tests\Functional\Controller; |
4
|
|
|
|
5
|
|
|
class AdminPerformanceControllerTest extends AbstractAdminController |
6
|
|
|
{ |
7
|
|
|
public function testPerformanceListAction() |
8
|
|
|
{ |
9
|
|
|
$this->request('/admin/Performance/list', 'GET', 302); |
10
|
|
|
|
11
|
|
|
$this->logIn(); |
12
|
|
|
|
13
|
|
|
$this->request('/admin/Performance/list', 'GET', 200); |
14
|
|
|
$this->assertAdminListPageHasColumns(['Main Picture', 'Title', 'Type', 'Seasons', 'Premiere', 'Festival']); |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
public function testPerformanceCreateAction() |
18
|
|
|
{ |
19
|
|
|
$this->request('/admin/Performance/create', 'GET', 302); |
20
|
|
|
|
21
|
|
|
$this->logIn(); |
22
|
|
|
|
23
|
|
|
$this->request('/admin/Performance/create', 'GET', 200); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
public function testPerformanceDeleteAction() |
27
|
|
|
{ |
28
|
|
|
$performance = $this->getEm()->getRepository('App:Performance')->findOneBy([]); |
29
|
|
|
$eventsCount1 = count($this->getEm()->getRepository('App:PerformanceEvent')->findAll()); |
30
|
|
|
$rolesCount1 = count($this->getEm()->getRepository('App:Role')->findAll()); |
31
|
|
|
|
32
|
|
|
$performanceRolesCount = $performance->getRoles()->count(); |
33
|
|
|
$performanceEventsCount = $performance->getPerformanceEvents()->count(); |
34
|
|
|
$this->processDeleteAction($performance); |
35
|
|
|
|
36
|
|
|
$eventsCount2 = count($this->getEm()->getRepository('App:PerformanceEvent')->findAll()); |
37
|
|
|
$rolesCount2 = count($this->getEm()->getRepository('App:Role')->findAll()); |
38
|
|
|
|
39
|
|
|
$this->assertEquals($eventsCount1 - $performanceEventsCount, $eventsCount2); |
40
|
|
|
$this->assertEquals($rolesCount1 - $performanceRolesCount, $rolesCount2); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|