Passed
Branch master (cd2b9b)
by Scott
03:31
created

ArgParserTest::testAlphaArgs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 11

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 0
dl 15
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace exussum12\CoverageChecker\tests;
3
4
use PHPUnit\Framework\TestCase;
5
use exussum12\CoverageChecker\ArgParser;
6
7
class ArgParserTest extends TestCase
8
{
9 View Code Duplication
    public function testNumericArgs()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
    {
11
        $args = [
12
            'file.php',
13
            '--some-opt',
14
            'file',
15
            '-a',
16
            'file2',
17
        ];
18
19
        $argParser = new ArgParser($args);
20
        $this->assertSame("file", $argParser->getArg(1));
21
        $this->assertSame("file2", $argParser->getArg(2));
22
        $this->assertNull($argParser->getArg(3));
23
    }
24
25 View Code Duplication
    public function testAlphaArgs()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
    {
27
        $args = [
28
            'file.php',
29
            '--some-opt',
30
            'file',
31
            '-a',
32
            'file2',
33
        ];
34
35
        $argParser = new ArgParser($args);
36
        $this->assertTrue($argParser->getArg('a'));
37
        $this->assertTrue($argParser->getArg('some-opt'));
38
        $this->assertFalse($argParser->getArg('non-existant'));
39
    }
40
}
41