Passed
Pull Request — master (#15)
by Dmitriy
13:06
created

ParamsConfigTest::configProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 23
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 34
rs 9.552
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Tests\Integration\Tests\Config;
6
7
use stdClass;
8
9
final class ParamsConfigTest extends ConfigTest
10
{
11
    public function configProvider(): array
12
    {
13
        return [
14
            ['boolean parameter', true],
15
            ['string parameter', 'value of param 1'],
16
            ['NAN parameter', 'NAN'],
17
            ['float parameter', 1.0000001],
18
            ['int parameter', 123],
19
            ['long int parameter', 123_000],
0 ignored issues
show
Bug introduced by
The constant Yiisoft\Composer\Config\...on\Tests\Config\123_000 was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
20
            ['array parameter', [[[[[[]]]]]]],
21
            [
22
                'callable parameter',
23
                function () {
24
                    return 'I am callable';
25
                },
26
            ],
27
            [
28
                'static callable parameter',
29
                static function () {
30
                    return 'I am callable';
31
                },
32
            ],
33
            ['object parameter', new stdClass()],
34
            /**
35
             * Test for subpackages parameters
36
             */
37
            ['first-vendor/first-package', true],
38
            ['first-vendor/second-package', true],
39
            ['first-dev-vendor/first-package', true],
40
            ['first-dev-vendor/second-package', true],
41
            ['second-vendor/first-package', true],
42
            ['second-vendor/second-package', true],
43
            ['second-dev-vendor/first-package', true],
44
            ['second-dev-vendor/second-package', true],
45
        ];
46
    }
47
48
    protected function getConfigName(): string
49
    {
50
        return 'params';
51
    }
52
}
53