Completed
Push — master ( c67200...14b415 )
by amaury
06:24
created

FormControllersSecurityTest::provideApiUrl()   A

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 22
Code Lines 19

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 22
rs 9.2
cc 1
eloc 19
nc 1
nop 0
1
<?php
2
3
namespace OpenOrchestra\FunctionalTests\BackofficeBundle\Controller;
4
5
use OpenOrchestra\FunctionalTests\Utils\AbstractAuthenticatedTest;
6
7
/**
8
 * Class FormControllersSecurityTest
9
 *
10
 * @group backofficeTest
11
 */
12
class FormControllersSecurityTest extends AbstractAuthenticatedTest
13
{
14
    protected $username = 'userNoAccess';
15
    protected $password = 'userNoAccess';
16
17
    /**
18
     * @param string $url
19
     *
20
     * @dataProvider provideApiUrl
21
     */
22
    public function testForm($url)
23
    {
24
        $this->client->request('GET', $url);
25
        $this->assertEquals(403, $this->client->getResponse()->getStatusCode());
26
    }
27
28
    /**
29
     * @return array
30
     */
31
    public function provideApiUrl()
32
    {
33
        return array(
34
            1  => array('/admin/node/new/2/fr/root/1'),
35
            4  => array('/admin/content-type/form/content-type-id'),
36
            5  => array('/admin/content-type/form/new'),
37
            6  => array('/admin/site/form/root'),
38
            7  => array('/admin/site/new'),
39
            8  => array('/admin/keyword/form/keyword-id'),
40
            9  => array('/admin/keyword/new'),
41
            10 => array('/admin/group/new'),
42
            11 => array('/admin/group/form/group-id'),
43
            12 => array('/admin/content/form/welcome/fr'),
44
            13 => array('/admin/content/new/news/en'),
45
            14 => array('/admin/redirection/form/redirection-id'),
46
            15 => array('/admin/redirection/new'),
47
            18 => array('/admin/status/form/root'),
48
            19 => array('/admin/status/new'),
49
            20 => array('/admin/block/new/shared/menu/fr'),
50
            22  => array('/admin/node/form/2/root/fr'),
51
        );
52
    }
53
}
54