Issues (98)

mQueueTest/Controller/ActivityControllerTest.php (1 issue)

1
<?php
2
3
namespace mQueueTest\Controller;
4
5
class ActivityControllerTest extends AbstractControllerTestCase
6
{
7
    protected function assertCommonThings(array $params): void
8
    {
9
        $this->assertModule($params['module']);
10
        $this->assertController($params['controller']);
11
        $this->assertAction($params['action']);
12
    }
13
14
    public function testIndexAction(): void
15
    {
16
        $params = ['action' => 'index', 'controller' => 'activity', 'module' => 'default'];
17
        $url = $this->url($this->urlizeOptions($params));
18
        $this->dispatch($url);
19
20
        // assertions
21
        $this->assertCommonThings($params);
22
23
        $this->assertQueryContentContains('h2', 'Overall activity');
24
    }
25
26
    public function testUserAction(): void
27
    {
28
        $params = ['action' => 'index', 'controller' => 'activity', 'module' => 'default', 'user' => $this->testUser->id];
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on mQueue\Model\User. Since you implemented __get, consider adding a @property annotation.
Loading history...
29
        $url = $this->url($this->urlizeOptions($params));
30
        $this->dispatch($url);
31
32
        // assertions
33
        $this->assertCommonThings($params);
34
35
        $this->assertQueryContentContains('h2', 'Activity for');
36
    }
37
38
    public function testMovieAction(): void
39
    {
40
        $params = ['action' => 'index', 'controller' => 'activity', 'module' => 'default', 'movie' => $this->movieData['id']];
41
        $url = $this->url($this->urlizeOptions($params));
42
        $this->dispatch($url);
43
44
        // assertions
45
        $this->assertCommonThings($params);
46
47
        $this->assertQueryContentContains('h2', 'Activity for ' . $this->movieData['title']);
48
    }
49
}
50