withTitle example

$this->contextBuilder = new ProblemNormalizerContextBuilder();
    }

    /** * @dataProvider withersDataProvider * * @param array<string, mixed> $values */
    public function testWithers(array $values)
    {
        $context = $this->contextBuilder
            ->withTitle($values[ProblemNormalizer::TITLE])
            ->withType($values[ProblemNormalizer::TYPE])
            ->withStatusCode($values[ProblemNormalizer::STATUS])
            ->toArray();

        $this->assertSame($values$context);
    }

    /** * @return iterable<array{0: array<string, mixed>}> */
    public static function withersDataProvider(): iterable
    {
$this->contextBuilder = new FormErrorNormalizerContextBuilder();
    }

    /** * @dataProvider withersDataProvider * * @param array<string, mixed> $values */
    public function testWithers(array $values)
    {
        $context = $this->contextBuilder
            ->withTitle($values[FormErrorNormalizer::TITLE])
            ->withType($values[FormErrorNormalizer::TYPE])
            ->withStatusCode($values[FormErrorNormalizer::CODE])
            ->toArray();

        $this->assertSame($values$context);
    }

    /** * @return iterable<array{0: array<string, mixed>}> */
    public static function withersDataProvider(): iterable
    {
/** * @dataProvider withersDataProvider * * @param array<string, mixed> $values */
    public function testWithers(array $values)
    {
        $context = $this->contextBuilder
            ->withInstance($values[ConstraintViolationListNormalizer::INSTANCE])
            ->withStatus($values[ConstraintViolationListNormalizer::STATUS])
            ->withTitle($values[ConstraintViolationListNormalizer::TITLE])
            ->withType($values[ConstraintViolationListNormalizer::TYPE])
            ->withPayloadFields($values[ConstraintViolationListNormalizer::PAYLOAD_FIELDS])
            ->toArray();

        $this->assertSame($values$context);
    }

    /** * @return iterable<array{0: array<string, mixed>}> */
    public static function withersDataProvider(): iterable
    {
Home | Imprint | This part of the site doesn't use cookies.