Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#7)
by Jérémiah
09:02
created

MergeFieldTraitTest::getFieldsDataProvider()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 31
rs 8.8571
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Tests\Definition;
13
14
use Overblog\GraphQLBundle\Definition\MergeFieldTrait;
15
16
class MergeFieldTraitTest extends \PHPUnit_Framework_TestCase
17
{
18
    use MergeFieldTrait;
19
20
    /**
21
     * @param $fields
22
     * @param array $defaultFields
23
     * @param $forceArray
24
     * @param $expectedFields
25
     *
26
     * @dataProvider getFieldsDataProvider
27
     */
28
    public function testGetFieldsWithDefaults($fields, array $defaultFields, $forceArray, $expectedFields)
29
    {
30
        $this->assertEquals($expectedFields, $this->getFieldsWithDefaults($fields, $defaultFields, $forceArray));
31
    }
32
33
    public function getFieldsDataProvider()
34
    {
35
        return [
36
            [
37
                ['toto', 'tata', 'titi'],
38
                ['foo', 'bar'],
39
                true,
40
                ['toto', 'tata', 'titi', 'foo', 'bar'],
41
            ],
42
            [
43
                [],
44
                ['foo'],
45
                true,
46
                ['foo'],
47
            ],
48
            [
49
                function () {
50
                    return ['test'];
51
                },
52
                ['bar'],
53
                true,
54
                ['test', 'bar'],
55
            ],
56
            [
57
                'toto',
58
                ['tata'],
59
                true,
60
                ['toto', 'tata'],
61
            ],
62
        ];
63
    }
64
65
    public function testGetFieldsWithDefaultsForceArray()
66
    {
67
        $fields = $this->getFieldsWithDefaults(function () { return ['bar']; }, ['toto'], false);
68
        $this->assertInstanceOf('Closure', $fields);
69
        $this->assertEquals(['bar', 'toto'], $fields());
70
    }
71
}
72