GraphQL\Tests\Utils\ValueFromAstTest::testCoercesInputObjectsAccordingToInputCoercionRules PHP Метод

testCoercesInputObjectsAccordingToInputCoercionRules() публичный Метод

    public function testCoercesInputObjectsAccordingToInputCoercionRules()
    {
        $testInputObj = $this->inputObj();
        $undefined = Utils::undefined();
        $this->runTestCase($testInputObj, 'null', null);
        $this->runTestCase($testInputObj, '123', $undefined);
        $this->runTestCase($testInputObj, '[]', $undefined);
        $this->runTestCase($testInputObj, '{ int: 123, requiredBool: false }', ['int' => 123, 'requiredBool' => false]);
        $this->runTestCase($testInputObj, '{ bool: true, requiredBool: false }', ['int' => 42, 'bool' => true, 'requiredBool' => false]);
        $this->runTestCase($testInputObj, '{ int: true, requiredBool: true }', $undefined);
        $this->runTestCase($testInputObj, '{ requiredBool: null }', $undefined);
        $this->runTestCase($testInputObj, '{ bool: true }', $undefined);
    }