FieldConfigTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInvalidParams() 0 16 1
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 5/12/16 7:08 PM
7
*/
8
9
namespace Youshido\Tests\Library\Config;
10
11
12
use Youshido\GraphQL\Config\Field\FieldConfig;
13
use Youshido\GraphQL\Type\Scalar\StringType;
14
15
class FieldConfigTest extends \PHPUnit_Framework_TestCase
16
{
17
18
    public function testInvalidParams()
19
    {
20
        $fieldConfig = new FieldConfig([
21
            'name'    => 'FirstName',
22
            'type'    => new StringType(),
23
            'resolve' => function ($value, $args = [], $type = null) {
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
                return 'John';
25
            }
26
        ]);
27
28
        $this->assertEquals('FirstName', $fieldConfig->getName());
29
        $this->assertEquals(new StringType(), $fieldConfig->getType());
30
31
        $resolveFunction = $fieldConfig->getResolveFunction();
32
        $this->assertEquals('John', $resolveFunction([]));
33
    }
34
35
}
36