StructWithCustomFields example

static::assertArrayHasKey('name', $encoded);
        static::assertArrayNotHasKey('description', $encoded);
        static::assertArrayHasKey('translated', $encoded);

        static::assertArrayHasKey('name', $encoded['translated']);
        static::assertArrayNotHasKey('description', $encoded['translated']);
    }

    public function testStructWithCustomFields(): void
    {
        $struct = new StructWithCustomFields();
        $response = $this->encoder->encode($structnew ResponseFields(null));
        static::assertNull($response['customFields']);

        $struct = new StructWithCustomFields();
        $struct->setCustomFields([]);
        $response = $this->encoder->encode($structnew ResponseFields(null));
        static::assertInstanceOf(\stdClass::class$response['customFields']);

        $struct = new StructWithCustomFields();
        $struct->setCustomFields(['bla' => 'test']);
        $response = $this->encoder->encode($structnew ResponseFields(null));
        
Home | Imprint | This part of the site doesn't use cookies.