Passed
Push — master ( 36f9d6...294ad3 )
by Mazarini
10:49
created

UrlControllerTest::getUrls()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * Copyright (C) 2019 Mazarini <[email protected]>.
5
 * This file is part of mazarini/design.
6
 *
7
 * mazarini/design is free software: you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation, either version 3 of the License, or (at your
10
 * option) any later version.
11
 *
12
 * mazarini/design is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15
 * more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 */
19
20
namespace App\Tests\Controller;
21
22
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
23
use Symfony\Component\HttpFoundation\Response;
24
25
class UrlControllerTest extends WebTestCase
26
{
27
    /**
28
     * @dataProvider getUrls
29
     */
30
    public function testUrls(string $url)
31
    {
32
        $client = static::createClient();
33
        $client->request('GET', $url);
34
35
        $this->assertSame(
36
            Response::HTTP_OK,
37
            $client->getResponse()->getStatusCode(),
38
            sprintf('The %s public URL loads correctly.', $url)
39
        );
40
    }
41
42
    public function getUrls()
43
    {
44
        yield ['/info'];
45
    }
46
}
47