Test Failed
Push — master ( a67bb9...70acd1 )
by Javi
05:12
created

GeneralApiTest::testRootHttp302()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace itsjavi\Flatdown\Tests;
3
4
class GeneralApiTest extends BaseTestCase
5
{
6
    public function testRootHttp302()
7
    {
8
        $response = $this->call($this->createRequest('GET', '/'));
9
10
        $this->assertEquals(302, $response->getStatusCode());
11
        $this->assertTrue($response->hasHeader('Location'));
12
    }
13
14
    public function testIndexHttp200()
15
    {
16
        $response = $this->call($this->createRequest('GET', '/_index'));
17
18
        $this->assertEquals(200, $response->getStatusCode());
19
    }
20
21
    public function testIndexWithSlashHttp301()
22
    {
23
        $response = $this->call($this->createRequest('GET', '/_index/'));
24
25
        $this->assertEquals(301, $response->getStatusCode());
26
    }
27
28
    public function testDemoHttp200()
29
    {
30
        $response = $this->call($this->createRequest('GET', '/demo'));
31
32
        $this->assertEquals(200, $response->getStatusCode());
33
    }
34
35
    public function testHttp404()
36
    {
37
        $response = $this->call($this->createRequest('GET', '/foobar'));
38
39
        $this->assertEquals(404, $response->getStatusCode());
40
    }
41
}
42