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.

ArgvInputExtendedTest::provideOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 53
Code Lines 41

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 53
rs 9.5797
c 1
b 0
f 1
cc 1
eloc 41
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * This file is part of the Gerrie package.
4
 *
5
 * (c) Andreas Grunwald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Gerrie\Tests\Component\Console;
12
13
use Gerrie\Component\Console\ArgvInputExtended;
14
use Symfony\Component\Console\Input\InputDefinition;
15
use Symfony\Component\Console\Input\InputOption;
16
17
class ArgvInputExtendedTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * @dataProvider provideOptions
21
     */
22
    public function testParseOptions($input, $options, $requestedOption, $expectedResult)
23
    {
24
        $input = new ArgvInputExtended($input);
25
        $input->bind(new InputDefinition($options));
26
27
        $this->assertEquals($expectedResult, $input->isOptionSet($requestedOption));
28
    }
29
30
    public function provideOptions()
31
    {
32
        return array(
33
            array(
34
                array('cli.php'),
35
                array(new InputOption('foo')),
36
                'foo',
37
                false,
38
            ),
39
            array(
40
                array('cli.php', '--foo'),
41
                array(new InputOption('foo')),
42
                'foo',
43
                true,
44
            ),
45
            array(
46
                array('cli.php', '--foo=bar'),
47
                array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
48
                'foo',
49
                true
50
            ),
51
            array(
52
                array('cli.php', '--foo', '--bar'),
53
                array(
54
                    new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL),
55
                    new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)
56
                ),
57
                'bar',
58
                true,
59
            ),
60
            array(
61
                array('cli.php', '--foo', '--bar'),
62
                array(
63
                    new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL),
64
                    new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)
65
                ),
66
                'baz',
67
                false,
68
            ),
69
            array(
70
                array('cli.php', '-f'),
71
                array(new InputOption('foo', 'f')),
72
                'foo',
73
                true,
74
            ),
75
            array(
76
                array('cli.php', '-fbar'),
77
                array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
78
                'foo',
79
                true,
80
            ),
81
        );
82
    }
83
}
84