Airship\UnitTests\AirshipTest::testArrayFromHttpQuery PHP Method

testArrayFromHttpQuery() public method

    public function testArrayFromHttpQuery()
    {
        $this->assertSame([], \Airship\array_from_http_query(''), 'Empty string should return empty array.');
        $this->assertSame(['foo' => 'bar'], \Airship\array_from_http_query('foo=bar'), 'foo=bar should become an array of size 1with key foo and element bar');
        $this->assertSame(['foo' => 'bar', 'apple' => '1'], \Airship\array_from_http_query('foo=bar&apple=1'));
        $this->assertSame(['foo' => 'bar', 'apple' => ['1']], \Airship\array_from_http_query('foo=bar&apple[]=1'), 'Arrays are not being respected');
        $this->assertSame(['foo' => 'bar', 'apple' => ['baz' => '1']], \Airship\array_from_http_query('foo=bar&apple[baz]=1'), 'Arrays are not being parsed correctly');
    }