17 import(
'lib.pkp.tests.PKPTestCase');
32 $configData[
'general'][
'base_url'] = $baseUrl;
35 $this->assertEquals($expectUrl, $actualUrl);
50 $configData[
'general'][
'base_url[' . $contextPath .
']'] = $baseUrl;
51 $configData[
'general'][
'base_url[test2]'] = $baseUrl .
'/test';
53 $configData[
'general'][
'base_url[art]'] = $baseUrl .
'/art';
56 $this->assertEquals($expectUrl, $actualUrl);
67 $cases[] = array(
'http://localhost/ojs',
'/',
'');
68 $cases[] = array(
'http://localhost/ojs',
'/index.php',
'');
69 $cases[] = array(
'http://localhost/ojs',
'/ojs',
'');
70 $cases[] = array(
'http://localhost/ojs',
'/ojs/index.php/ojs/index',
'/ojs/index');
71 $cases[] = array(
'http://localhost/ojs',
'/ojs/index.php/ojstest/index',
'/ojstest/index');
73 $cases[] = array(
'http://localhost/ojs',
'/ojs/ojstest/index',
'/ojstest/index');
76 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/',
'');
77 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php',
'');
78 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php/ojstest/index',
'/ojstest/index');
79 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php/ojstest/index/index/path?arg1=arg&arg2=arg',
'/ojstest/index/index/path?arg1=arg&arg2=arg');
81 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/ojstest/index',
'/ojstest/index');
84 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php?journal=test',
'?journal=test');
85 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs',
'');
86 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php',
'');
87 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php?',
'?');
89 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs?journal=test',
'?journal=test');
92 $cases[] = array(
'http://localhost/ojs',
'/ojs/index.php?journal=test',
'?journal=test');
93 $cases[] = array(
'http://localhost/ojs',
'/ojs',
'');
94 $cases[] = array(
'http://localhost/ojs',
'/ojs/index.php',
'');
95 $cases[] = array(
'http://localhost/ojs',
'/ojs/index.php?',
'?');
97 $cases[] = array(
'http://localhost/ojs',
'/ojs?journal=test',
'?journal=test');
100 $cases[] = array(
'http://localhost/ojs',
'http://localhost/ojs/index.php/art/article/view/100',
'/art/article/view/100');
113 $cases[] = array(
'test',
'http://localhost',
'/',
'/test');
114 $cases[] = array(
'test',
'http://localhost',
'/?',
'/test/?');
117 $cases[] = array(
'test',
'http://localhost',
'http://localhost',
'/test');
118 $cases[] = array(
'test',
'http://localhost',
'http://localhost/?',
'/test/?');
121 $cases[] = array(
'test',
'http://localhost/ojs',
'/ojs/index',
'/test/index');
123 $cases[] = array(
'test',
'http://localhost/ojs',
'/ojs/index.php/index',
'/test/index');
126 $cases[] = array(
'test',
'http://localhost/ojstest',
'/ojstest/test/index',
false);
128 $cases[] = array(
'test',
'http://localhost/ojstest',
'/ojstest/index.php/test/index',
'/test/index');
131 $cases[] = array(
'test1',
'http://localhost',
'/test/index',
'/test2/index');
132 $cases[] = array(
'test1',
'http://localhost',
'/test/index',
'/test2/index');
134 $cases[] = array(
'test1',
'http://localhost',
'/test/index.php?journal=test2&page=index',
'/test2?journal=test2&page=index');
136 $cases[] = array(
'test1',
'http://localhost',
'/test?journal=test2&page=index',
'/test2?journal=test2&page=index');
139 $cases[] = array(
'test',
'http://localhost/ojstest',
'/ojstest?journal=test&page=index',
'/test?journal=test&page=index');
141 $cases[] = array(
'test',
'http://localhost/ojstest',
'/ojstest/index.php?journal=test&page=index',
'/test?journal=test&page=index');
144 $cases[] = array(
'art',
'http://localhost',
'http://localhost/art/article/view/100',
'/art/article/view/100');