You are here

public function FunctionsTest::parseParamsProvider in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/tests/FunctionsTest.php \GuzzleHttp\Tests\Psr7\FunctionsTest::parseParamsProvider()

File

vendor/guzzlehttp/psr7/tests/FunctionsTest.php, line 455

Class

FunctionsTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function parseParamsProvider() {
  $res1 = array(
    array(
      '<http:/.../front.jpeg>',
      'rel' => 'front',
      'type' => 'image/jpeg',
    ),
    array(
      '<http://.../back.jpeg>',
      'rel' => 'back',
      'type' => 'image/jpeg',
    ),
  );
  return array(
    array(
      '<http:/.../front.jpeg>; rel="front"; type="image/jpeg", <http://.../back.jpeg>; rel=back; type="image/jpeg"',
      $res1,
    ),
    array(
      '<http:/.../front.jpeg>; rel="front"; type="image/jpeg",<http://.../back.jpeg>; rel=back; type="image/jpeg"',
      $res1,
    ),
    array(
      'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"',
      array(
        array(
          'foo' => 'baz',
          'bar' => '123',
        ),
        array(
          'boo',
        ),
        array(
          'test' => '123',
        ),
        array(
          'foobar' => 'foo;bar',
        ),
      ),
    ),
    array(
      '<http://.../side.jpeg?test=1>; rel="side"; type="image/jpeg",<http://.../side.jpeg?test=2>; rel=side; type="image/jpeg"',
      array(
        array(
          '<http://.../side.jpeg?test=1>',
          'rel' => 'side',
          'type' => 'image/jpeg',
        ),
        array(
          '<http://.../side.jpeg?test=2>',
          'rel' => 'side',
          'type' => 'image/jpeg',
        ),
      ),
    ),
    array(
      '',
      array(),
    ),
  );
}