GraphQL\Tests\Utils\ValueFromAstTest::testAssertsVariablesAreProvidedAsItemsInLists PHP Method

testAssertsVariablesAreProvidedAsItemsInLists() public method

    public function testAssertsVariablesAreProvidedAsItemsInLists()
    {
        $listOfBool = Type::listOf(Type::boolean());
        $listOfNonNullBool = Type::listOf(Type::nonNull(Type::boolean()));
        $this->runTestCaseWithVars([], $listOfBool, '[ $foo ]', [null]);
        $this->runTestCaseWithVars([], $listOfNonNullBool, '[ $foo ]', Utils::undefined());
        $this->runTestCaseWithVars(['foo' => true], $listOfNonNullBool, '[ $foo ]', [true]);
        // Note: variables are expected to have already been coerced, so we
        // do not expect the singleton wrapping behavior for variables.
        $this->runTestCaseWithVars(['foo' => true], $listOfNonNullBool, '$foo', true);
        $this->runTestCaseWithVars(['foo' => [true]], $listOfNonNullBool, '$foo', [true]);
    }