Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Relay/Connection/Output/ConnectionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Overblog\GraphQLBundle\Relay\Connection\Output;

use Overblog\GraphQLBundle\Definition\Argument;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
* Class ConnectionBuilder.
Expand Down Expand Up @@ -178,7 +177,7 @@ public static function getOffsetWithDefault($cursor, $defaultOffset)
}
$offset = static::cursorToOffset($cursor);

return !is_numeric($offset) ? $defaultOffset : (int) $offset;
return !is_numeric($offset) ? $defaultOffset : (int) $offset;
}

/**
Expand Down Expand Up @@ -207,9 +206,6 @@ public static function cursorToOffset($cursor)

private static function getOptionsWithDefaults(array $options, array $defaults)
{
$arraySliceResolver = new OptionsResolver();
$arraySliceResolver->setDefaults($defaults);

return $arraySliceResolver->resolve($options);
return $options + $defaults;
}
}
1 change: 1 addition & 0 deletions Resources/config/routing/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ overblog_graphql_endpoint:
path: /
defaults:
_controller: OverblogGraphQLBundle:Graph:endpoint
_format: "json"
9 changes: 8 additions & 1 deletion Tests/DIContainerMockTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@

namespace Overblog\GraphQLBundle\Tests;

/**
* Class DIContainerMockTrait
*
* @method \PHPUnit_Framework_MockObject_MockBuilder getMockBuilder (string $className)
*/
trait DIContainerMockTrait
{
private function getDIContainerMock(array $services = [], array $parameters = [])
{
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\Container', ['get', 'getParameter', 'has']);
$container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')
->setMethods(['get', 'getParameter', 'has'])
->getMock();

$getMethod = $container->expects($this->any())->method('get');

Expand Down