deprecated example


        $this->expectException(OptionDefinitionException::class);
        $this->expectExceptionMessage('The option "foo" is already defined.');
        $this->resolver->define('foo');
        $this->resolver->define('foo');
    }

    public function testResolveOptionsDefinedByOptionConfigurator()
    {
        $this->resolver->define('foo')
            ->required()
            ->deprecated('vendor/package', '1.1')
            ->default('bar')
            ->allowedTypes('string', 'bool')
            ->allowedValues('bar', 'zab')
            ->normalize(static fn (Options $options$value) => $value)
            ->info('info message')
        ;
        $introspector = new OptionsResolverIntrospector($this->resolver);

        $this->assertTrue(true, $this->resolver->isDefined('foo'));
        $this->assertTrue(true, $this->resolver->isDeprecated('foo'));
        $this->assertTrue(true, $this->resolver->hasDefault('foo'));
        
Home | Imprint | This part of the site doesn't use cookies.