; rel="next", ; rel="last"', array( 'next' => 'https://api.github.com/repositories/48178744/commits?page=2', 'last' => 'https://api.github.com/repositories/48178744/commits?page=23' ), 'github header' ), array( '; rel="next", ; rel="first", ; rel="last"', array( 'next' => 'https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=2&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc', 'first' => 'https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=1&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc', 'last' => 'https://gitlab.cosmocode.de/api/v3/groups/dokuwiki/projects?id=dokuwiki&page=2&per_page=20&private_token=TGVvcy_D6MMCXxnZALTc' ), 'gitlab header' ) ); } /** * @dataProvider parseHTTPLinkHeaders_testdata * * @param string $linkHeader * @param array $expected_links * @param string $msg */ public function test_parseHTTPLinkHeaders($linkHeader, $expected_links, $msg) { /** @var helper_plugin_issuelinks_util $helper*/ $helper = plugin_load('helper', 'issuelinks_util'); $actual_links = $helper->parseHTTPLinkHeaders($linkHeader); $this->assertSame($expected_links, $actual_links, $msg); } }