set('path_helper', $path_helper); } public function build_url_test_data() { return array( array( 'index.php', false, 'phpBB/index.php?', ), array( 'index.php', 't', 'phpBB/index.php?', ), array( 'viewtopic.php?f=2&style=1&t=6', 'f', 'phpBB/viewtopic.php?style=1&t=6', ), array( 'viewtopic.php?f=2&style=1&t=6', array('f', 'style', 't'), 'phpBB/viewtopic.php?', ), array( 'http://test.phpbb.com/viewtopic.php?f=2&style=1&t=6', array('f', 'style', 't'), 'http://test.phpbb.com/viewtopic.php?', ), ); } /** * @dataProvider build_url_test_data */ public function test_build_url($page, $strip_vars, $expected) { global $user, $phpbb_root_path; $user->page['page'] = $page; $output = build_url($strip_vars); $this->assertEquals($expected, $output); } }