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

CorsEnableControllerCollectionTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 18
rs 9.4285
cc 1
eloc 11
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 CorsEnableControllerCollectionTest 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
        $controllers = $app["controllers_factory"];
20
        $controllers->get("/", function () {
21
            return "foo";
22
        });
23
        $app->mount("/foo", $app["cors-enabled"]($controllers));
24
25
        $app->get("/bar", function () {
26
            return "bar";
27
        });
28
29
        $this->client = new Client($app, ["HTTP_ORIGIN" => "http://www.foo.com"]);
30
    }
31
32
    public function testEnabledPreflight()
33
    {
34
        $this->client->request("OPTIONS", "/foo/");
35
        $response = $this->client->getResponse();
36
37
        $this->assertTrue($response->isEmpty());
38
        $this->assertTrue($response->headers->has("Access-Control-Allow-Origin"));
39
    }
40
41
    public function testNotEnabledPreflight()
42
    {
43
        $this->client->request("OPTIONS", "/bar");
44
        $response = $this->client->getResponse();
45
46
        $this->assertTrue($response->isEmpty());
47
        $this->assertFalse($response->headers->has("Access-Control-Allow-Origin"));
48
    }
49
50
    public function testEnabledController()
51
    {
52
        $this->client->request("GET", "/foo/");
53
        $response = $this->client->getResponse();
54
55
        $this->assertTrue($response->isOk());
56
        $this->assertTrue($response->headers->has("Access-Control-Allow-Origin"));
57
    }
58
59
    public function testNotEnabledController()
60
    {
61
        $this->client->request("GET", "/bar");
62
        $response = $this->client->getResponse();
63
64
        $this->assertTrue($response->isOk());
65
        $this->assertFalse($response->headers->has("Access-Control-Allow-Origin"));
66
    }
67
}
68