GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( b25063...8f09af )
by Jason
02:08
created

CorsEnableControllerTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 17
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace JDesrosiers\Silex\Provider\Test;
4
5
use JDesrosiers\Silex\Provider\CorsServiceProvider;
6
use Silex\Application;
7
use Symfony\Component\HttpKernel\Client;
8
9
class CorsEnableControllerTest extends \PHPUnit_Framework_TestCase
10
{
11
    protected $client;
12
13
    public function setUp()
14
    {
15
        $app = new Application();
16
        $app["debug"] = true;
17
        $app->register(new CorsServiceProvider());
18
19
        $controller = $app->get("/foo", function () {
20
            return "foo";
21
        });
22
        $app["cors-enabled"]($controller);
23
24
        $app->get("/bar", function () {
25
            return "bar";
26
        });
27
28
        $this->client = new Client($app, ["HTTP_ORIGIN" => "http://www.foo.com"]);
29
    }
30
31
    public function testEnabledPreflight()
32
    {
33
        $this->client->request("OPTIONS", "/foo");
34
        $response = $this->client->getResponse();
35
36
        $this->assertTrue($response->isEmpty());
37
        $this->assertTrue($response->headers->has("Access-Control-Allow-Origin"));
38
    }
39
40
    public function testNotEnabledPreflight()
41
    {
42
        $this->client->request("OPTIONS", "/bar");
43
        $response = $this->client->getResponse();
44
45
        $this->assertTrue($response->isEmpty());
46
        $this->assertFalse($response->headers->has("Access-Control-Allow-Origin"));
47
    }
48
49
    public function testEnabledController()
50
    {
51
        $this->client->request("GET", "/foo");
52
        $response = $this->client->getResponse();
53
54
        $this->assertTrue($response->isOk());
55
        $this->assertTrue($response->headers->has("Access-Control-Allow-Origin"));
56
    }
57
58
    public function testNotEnabledController()
59
    {
60
        $this->client->request("GET", "/bar");
61
        $response = $this->client->getResponse();
62
63
        $this->assertTrue($response->isOk());
64
        $this->assertFalse($response->headers->has("Access-Control-Allow-Origin"));
65
    }
66
}
67