GeneralApiTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 38
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testRootHttp302() 0 7 1
A testIndexHttp200() 0 6 1
A testIndexWithSlashHttp301() 0 6 1
A testDemoHttp200() 0 6 1
A testHttp404() 0 6 1
1
<?php
2
namespace 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