Neos\ContentRepository\Tests\Unit\Domain\Service\ConfigurationContentDimensionPresetSourceTest::isPresetCombinationAllowedByConstraintsCorrectlyEvaluatesCombinationsOfWildcardAndExplicitConstraints PHP Method

isPresetCombinationAllowedByConstraintsCorrectlyEvaluatesCombinationsOfWildcardAndExplicitConstraints() public method

    public function isPresetCombinationAllowedByConstraintsCorrectlyEvaluatesCombinationsOfWildcardAndExplicitConstraints()
    {
        $source = new ConfigurationContentDimensionPresetSource();
        $configuration = $this->configurationWithThreeDimensionsAndManyValues;
        $configuration['country']['presets']['US']['constraints']['language']['*'] = false;
        $configuration['country']['presets']['US']['constraints']['language']['de'] = true;
        $configuration['country']['presets']['US']['constraints']['language']['en'] = true;
        $source->setConfiguration($configuration);
        # Not affected by wildcard:
        $this->assertTrue($source->isPresetCombinationAllowedByConstraints(array('language' => 'de', 'country' => 'DE')));
        # Affected by wildcard but explicitly allowed:
        $this->assertTrue($source->isPresetCombinationAllowedByConstraints(array('language' => 'de', 'country' => 'US')));
        $this->assertTrue($source->isPresetCombinationAllowedByConstraints(array('language' => 'en', 'country' => 'US')));
        # Affected by wildcard and thus not allowed:
        $this->assertFalse($source->isPresetCombinationAllowedByConstraints(array('language' => 'it', 'country' => 'US')));
        $this->assertFalse($source->isPresetCombinationAllowedByConstraints(array('language' => 'fr', 'country' => 'US')));
    }