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
Pull Request — master (#109)
by Jan
08:23
created

CallableClass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 6
rs 10
1
<?php
2
/*
3
 * Copyright 2016 Jan Eichhorn <[email protected]>
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
namespace ApaiIO\Test\Configuration;
19
20
use ApaiIO\Configuration\GenericConfiguration;
21
use ApaiIO\Request\Rest\Request;
22
use ApaiIO\ResponseTransformer\XmlToDomDocument;
23
24
class GenericConfigurationTest extends \PHPUnit_Framework_TestCase
25
{
26
    public function testGettersAndSetters()
27
    {
28
        $object = new GenericConfiguration();
29
30
        $object->setAccessKey('ABC');
31
        $object->setSecretKey('DEF');
32
        $object->setAssociateTag('GHI');
33
        $object->setResponseTransformer($a = new XmlToDomDocument());
34
        $object->setRequest($b = new Request($this->prophesize('\GuzzleHttp\ClientInterface')->reveal()));
35
36
        $this->assertSame('ABC', $object->getAccessKey());
37
        $this->assertSame('DEF', $object->getSecretKey());
38
        $this->assertSame('GHI', $object->getAssociateTag());
39
        $this->assertSame($a, $object->getResponseTransformer());
40
        $this->assertSame($b, $object->getRequest());
41
    }
42
43
    /**
44
     * @expectedException InvalidArgumentException
45
     */
46
    public function testCountryException()
47
    {
48
        $object = new GenericConfiguration();
49
        $object->setCountry('no country');
50
    }
51
52
    public function testCountrySetter()
53
    {
54
        $object = new GenericConfiguration();
55
        $object->setCountry('DE');
56
57
        $this->assertEquals('de', $object->getCountry());
58
    }
59
}
60