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 (#5)
by Scott van
09:49
created

ConfigLocatorTest::testGetPayloadConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * Copyright (c) 2013-2014 eBay Enterprise, Inc.
4
 *
5
 * NOTICE OF LICENSE
6
 *
7
 * This source file is subject to the Open Software License (OSL 3.0)
8
 * that is bundled with this package in the file LICENSE.md.
9
 * It is also available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * @copyright   Copyright (c) 2013-2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
13
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
14
 */
15
16
namespace eBayEnterprise\RetailOrderManagement\Payload;
17
18
class ConfigLocatorTest extends \PHPUnit_Framework_TestCase
19
{
20
    const TEST_PAYLOAD_TYPE = '\eBayEnterprise\RetailOrderManagement\Payload\Test';
21
    /** @var array */
22
    protected $testPayloadConfig;
23
    /** @var array */
24
    protected $config;
25
26
    public function setUp()
27
    {
28
        $this->testPayloadConfig = [
29
            'validators' => [['validator' => 'SomeValidator', 'params' => []]],
30
            'validatorIterator' => 'ValidatorIterator',
31
            'schemaValidator' => 'SchemaValidator',
32
            'childPayloads' => ['payloadMap' => 'PayloadMap', 'types' => []],
33
        ];
34
        $this->config = [self::TEST_PAYLOAD_TYPE => $this->testPayloadConfig];
35
        $this->locator = new ConfigLocator($this->config);
0 ignored issues
show
Bug introduced by
The property locator does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
36
    }
37
38
    public function testHasPayoadConfig()
39
    {
40
        $this->assertTrue($this->locator->hasPayloadConfig(self::TEST_PAYLOAD_TYPE));
41
        $this->assertFalse($this->locator->hasPayloadConfig('NotAPayloadTestType'));
42
    }
43
44
    public function testGetPayloadConfig()
45
    {
46
        $this->assertSame(
47
            $this->locator->getPayloadConfig(self::TEST_PAYLOAD_TYPE),
48
            $this->testPayloadConfig
49
        );
50
    }
51
52
    public function testUnsupportedPayloadExceptionForUnknownType()
53
    {
54
        $this->setExpectedException('\eBayEnterprise\RetailOrderManagement\Payload\Exception\UnsupportedPayload');
55
        $this->locator->getPayloadConfig('NotAPayloadTestType');
56
    }
57
}
58