GraphQL\Tests\Executor\VariablesTest::testDoesNotAllowListsOfNonNullsToContainNull PHP Method

testDoesNotAllowListsOfNonNullsToContainNull() public method

    public function testDoesNotAllowListsOfNonNullsToContainNull()
    {
        $doc = '
        query q($input:[String!]) {
          listNN(input: $input)
        }
        ';
        $ast = Parser::parse($doc);
        $expected = FormattedError::create('Variable "$input" got invalid value ["A",null,"B"].' . "\n" . 'In element #1: Expected "String!", found null.', [new SourceLocation(2, 17)]);
        try {
            Executor::execute($this->schema(), $ast, null, null, ['input' => ['A', null, 'B']]);
            $this->fail('Expected exception not thrown');
        } catch (Error $e) {
            $this->assertEquals($expected, Error::formatError($e));
        }
    }