Completed
Pull Request — master (#9)
by Quang
04:07
created

UpdateSchemaLockCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testHandle() 0 14 1
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Tests\Commands;
4
5
use Digia\Lumen\GraphQL\GraphQLService;
6
use Digia\Lumen\GraphQL\Tests\TestCase;
7
use Digia\Lumen\GraphQL\Commands\UpdateSchemaLockCommand;
8
9
/**
10
 * Class UpdateSchemaLockCommand
11
 * @package Digia\Lumen\GraphQL\Tests\Commands
12
 */
13
class UpdateSchemaLockCommandTest extends TestCase
14
{
15
    /**
16
     * Tests that the command correctly calls the service
17
     */
18
    public function testHandle()
19
    {
20
        /** @var \PHPUnit_Framework_MockObject_MockObject|GraphQLService $service */
21
        $service = $this->getMockBuilder(GraphQLService::class)
22
                        ->disableOriginalConstructor()
23
                        ->setMethods(['getStoredQueryResponse'])
24
                        ->getMock();
25
26
        $service->expects($this->once())
27
                ->method('getStoredQueryResponse')
28
                ->with('graphql/Introspection.graphql');
0 ignored issues
show
Bug introduced by
'graphql/Introspection.graphql' of type string is incompatible with the type array expected by parameter $arguments of PHPUnit_Framework_MockOb...nvocationMocker::with(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

28
                ->with(/** @scrutinizer ignore-type */ 'graphql/Introspection.graphql');
Loading history...
29
30
        $command = new UpdateSchemaLockCommand($service);
31
        $command->handle();
32
    }
33
}
34