Failed Conditions
Push — master ( 008819...bd15c6 )
by Adrien
04:03
created

MovieControllerTest::testAddAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace mQueueTest\Controller;
4
5
class MovieControllerTest extends AbstractControllerTestCase
6
{
7
    public function testIndexAction(): void
8
    {
9
        $params = ['action' => 'index', 'controller' => 'movie', 'module' => 'default'];
10
        $url = $this->url($this->urlizeOptions($params));
11
        $this->dispatch($url);
12
13
        // assertions
14
        $this->assertModule($params['module']);
15
        $this->assertController($params['controller']);
16
        $this->assertAction($params['action']);
17
18
        $this->assertQueryContentContains('legend', 'Filter');
19
        $this->assertQueryContentContains('th a', 'Title');
20
    }
21
22
    public function testAddAction(): void
23
    {
24
        $params = ['action' => 'add', 'controller' => 'movie', 'module' => 'default'];
25
        $url = $this->url($this->urlizeOptions($params));
26
        $this->dispatch($url);
27
28
        // assertions
29
        $this->assertModule($params['module']);
30
        $this->assertController($params['controller']);
31
        $this->assertAction($params['action']);
32
33
        $this->assertQueryContentContains('label', 'IMDb url or id');
34
        $this->assertQueryContentContains('.tips', 'learn how to add');
35
    }
36
37
    public function testImportAction(): void
38
    {
39
        $params = ['action' => 'import', 'controller' => 'movie', 'module' => 'default'];
40
        $url = $this->url($this->urlizeOptions($params));
41
        $this->dispatch($url);
42
43
        // assertions
44
        $this->assertModule($params['module']);
45
        $this->assertController($params['controller']);
46
        $this->assertAction($params['action']);
47
48
        $this->assertQueryContentContains('label', 'Vote History');
49
        $this->assertQueryContentContains('label', 'Minimum for favorite');
50
        $this->assertQueryContentContains('label', 'Minimum for excellent');
51
        $this->assertQueryContentContains('label', 'Minimum for ok');
52
        $this->assertQueryContentContains('.tips', 'learn how to add');
53
    }
54
}
55