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

UpdateSchemaLockCommandTest::testHandle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 9.4285
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