Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
URL-encodes string
<?php urlencode(string $string): string
<?php             foreach ($this->event['multiValueQueryStringParameters'] as $key => $value) {

                foreach ($value as $v) {

                    $queryParameterStr[] = $key . '=' . urlencode($v);

                }

            }
<?php         $expectedHeader = array_map(function (string $value, string $key): string {

            return $key . '=' . urlencode($value);

        }, $expected, array_keys($expected));

        $this->assertEquals(implode('; ', $expectedHeader), $this->event->getHeaders()['cookie'][0] ?? '');

    }