HostTest::testWrongHost()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of the silex-annotation-provider package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @license       MIT License
8
 * @copyright (c) 2018, Dana Desrosiers <[email protected]>
9
 */
10
11
namespace DDesrosiers\Test\SilexAnnotations\Annotations;
12
13
use DDesrosiers\Test\SilexAnnotations\AnnotationTestBase;
14
15
class HostTest extends AnnotationTestBase
16
{
17
    public function testCorrectHost()
18
    {
19
        $this->clientOptions = array('HTTP_HOST' => 'www.test.com');
20
        $this->assertEndPointStatus(self::GET_METHOD, "/test/hostTest", self::STATUS_OK);
21
    }
22
23
    public function testWrongHost()
24
    {
25
        $this->clientOptions = array('HTTP_HOST' => 'www.wrong.com');
26
        $this->assertEndPointStatus(self::GET_METHOD, "/test/hostTest", self::STATUS_NOT_FOUND);
27
    }
28
29
    public function testCorrectHostCollection()
30
    {
31
        $this->clientOptions = array('HTTP_HOST' => 'www.test.com');
32
        $this->assertEndPointStatus(self::GET_METHOD, "/hostTest/test", self::STATUS_OK);
33
    }
34
35
    public function testWrongHostCollection()
36
    {
37
        $this->clientOptions = array('HTTP_HOST' => 'www.wrong.com');
38
        $this->assertEndPointStatus(self::GET_METHOD, "/hostTest/test", self::STATUS_NOT_FOUND);
39
    }
40
}
41