setNormalizeKeys example

$this->prototype->parent = $node;
            $node->setPrototype($this->prototype->getNode());
        }

        $node->setAllowNewKeys($this->allowNewKeys);
        $node->addEquivalentValue(null, $this->nullEquivalent);
        $node->addEquivalentValue(true, $this->trueEquivalent);
        $node->addEquivalentValue(false, $this->falseEquivalent);
        $node->setPerformDeepMerging($this->performDeepMerging);
        $node->setRequired($this->required);
        $node->setIgnoreExtraKeys($this->ignoreExtraKeys, $this->removeExtraKeys);
        $node->setNormalizeKeys($this->normalizeKeys);

        if ($this->deprecation) {
            $node->setDeprecated($this->deprecation['package']$this->deprecation['version']$this->deprecation['message']);
        }

        if (isset($this->normalization)) {
            $node->setNormalizationClosures($this->normalization->before);
            $node->setNormalizedTypes($this->normalization->declaredTypes);
            $node->setXmlRemappings($this->normalization->remappings);
        }

        

           ],
        ];
    }

    /** * @dataProvider getPrototypedArrayNodeDataToMerge */
    public function testPrototypedArrayNodeMerge(array $left, array $right, array $expected)
    {
        $node = new PrototypedArrayNode('options');
        $node->setNormalizeKeys(false);
        $node->setPrototype(new VariableNode('value'));
        $node->setDefaultValue([]);

        $result = $node->merge($left$right);

        self::assertSame($result$expected);
    }

    public static function getPrototypedArrayNodeDataToMerge(): array
    {
        return [
            
Home | Imprint | This part of the site doesn't use cookies.