RequestInputTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testParamsCorrectlySetted() 0 19 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineModuleTest\Component\Console\Input;
6
7
use DoctrineModule\Component\Console\Input\RequestInput;
8
use Laminas\Console\Request;
9
use PHPUnit\Framework\TestCase;
10
use function array_shift;
11
12
/**
13
 * Tests for {@see \DoctrineModule\Component\Console\Input\RequestInput}
14
 */
15
class RequestInputTest extends TestCase
16
{
17
    /**
18
     * @covers \DoctrineModule\Component\Console\Input\RequestInput
19
     */
20
    public function testParamsCorrectlySetted() : void
21
    {
22
        $params = [
23
            'scriptname.php',
24
            'list',
25
            '--help',
26
            '--foo=bar',
27
        ];
28
29
        $request = new Request($params);
30
31
        $input = new RequestInput($request);
32
33
        array_shift($params);
34
35
        $this->assertTrue($input->hasParameterOption('list'));
36
        $this->assertTrue($input->hasParameterOption('--help'));
37
        $this->assertSame('bar', $input->getParameterOption('--foo'));
38
    }
39
}
40