for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is a part of GraphQL project.
*
* @author Alexandr Viniychuk <[email protected]>
* created: 5/12/16 7:08 PM
*/
namespace Youshido\Tests\Library\Config;
use Youshido\GraphQL\Config\Field\FieldConfig;
use Youshido\GraphQL\Type\Scalar\StringType;
class FieldConfigTest extends \PHPUnit_Framework_TestCase
{
public function testInvalidParams()
$fieldConfig = new FieldConfig([
'name' => 'FirstName',
'type' => new StringType(),
'resolve' => function ($value, $args = [], $type = null) {
$value
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$args
$type
return 'John';
}
]);
$this->assertEquals('FirstName', $fieldConfig->getName());
$this->assertEquals(new StringType(), $fieldConfig->getType());
$resolveFunction = $fieldConfig->getResolveFunction();
$this->assertEquals('John', $resolveFunction([]));
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.