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.

MethodParserTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 14 1
A shouldParseMethodData() 0 12 1
A shouldParseMethodAndReturnRawParameters() 0 12 1
A shouldParseMethodAndReturnRawReturn() 0 8 1
1
<?php
2
/**
3
 * MethodParserTest
4
 *
5
 * @author Piotr Olaszewski <[email protected]>
6
 */
7
use WSDL\Parser\MethodParser;
8
9
class MethodParserTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
    private $_methodName;
12
    private $_methodDoc;
13
14
    protected function setUp()
15
    {
16
        parent::setUp();
17
        $this->_methodName = 'addUser';
18
        $this->_methodDoc = <<<'DOC'
19
/**
20
 * @desc Method to adding user
21
 * @param string $name
22
 * @param object $address @string=ip @string=mac
23
 * @param wrapper[] $relatives @className=\Mocks\MockClass
24
 * @return bool $return
25
 */
26
DOC;
27
    }
28
29
    /**
30
     * @test
31
     */
32
    public function shouldParseMethodData()
33
    {
34
        //when
35
        $parser = new MethodParser($this->_methodName, $this->_methodDoc);
36
37
        //then
38
        $this->assertEquals('Method to adding user', $parser->description());
39
        $this->assertCount(3, $parser->parameters());
40
        $this->assertInstanceOf('WSDL\Types\Simple', $parser->returning());
41
        $this->assertEquals($this->_methodDoc, $parser->getDoc());
42
        $this->assertEquals($this->_methodName, $parser->getName());
43
    }
44
45
    /**
46
     * @test
47
     */
48
    public function shouldParseMethodAndReturnRawParameters()
49
    {
50
        //when
51
        $parser = new MethodParser($this->_methodName, $this->_methodDoc);
52
53
        //then
54
        $this->assertEquals(array(
55
            'string $name',
56
            'object $address @string=ip @string=mac',
57
            'wrapper[] $relatives @className=\Mocks\MockClass'
58
        ), $parser->getRawParameters());
59
    }
60
61
    /**
62
     * @test
63
     */
64
    public function shouldParseMethodAndReturnRawReturn()
65
    {
66
        //when
67
        $parser = new MethodParser($this->_methodName, $this->_methodDoc);
68
69
        //then
70
        $this->assertEquals('bool $return', $parser->getRawReturn());
71
    }
72
}
73