1515class controller_manifest_test extends \phpbb_test_case
1616{
1717 protected $ config ;
18- protected $ path_helper ;
1918 protected $ user ;
2019 protected $ manifest ;
2120
2221 protected function setUp (): void
2322 {
24- global $ phpbb_root_path , $ phpEx ;
25- global $ config , $ user , $ request , $ symfony_request ;
23+ global $ config , $ user , $ phpbb_root_path , $ phpEx ;
2624
2725 parent ::setUp ();
2826
@@ -38,21 +36,14 @@ protected function setUp(): void
3836 $ lang_loader = new \phpbb \language \language_file_loader ($ phpbb_root_path , $ phpEx );
3937 $ language = new \phpbb \language \language ($ lang_loader );
4038 $ user = $ this ->user = new \phpbb \user ($ language , '\phpbb\datetime ' );
41- $ symfony_request = $ this ->createMock (\phpbb \symfony_request::class);
42- $ request = $ this ->request = $ this ->createMock (\phpbb \request \request_interface::class);
43- $ this ->path_helper = new \phpbb \path_helper ($ symfony_request , new \phpbb \filesystem \filesystem (), $ this ->request , $ phpbb_root_path , $ phpEx );
44-
45- $ this ->manifest = new \phpbb \webpushnotifications \controller \manifest (
46- $ this ->config ,
47- $ this ->path_helper ,
48- $ this ->user
49- );
39+
40+ $ this ->manifest = new \phpbb \webpushnotifications \controller \manifest ($ this ->config , $ this ->user );
5041 }
5142
5243 public function manifest_data ()
5344 {
5445 return [
55- 'using web root path ' => [
46+ 'using board url root path ' => [
5647 [
5748 'force_server_vars ' => false ,
5849 'script_path ' => '' ,
@@ -64,14 +55,14 @@ public function manifest_data()
6455 'short_name ' => 'yourdomain ' ,
6556 'display ' => 'standalone ' ,
6657 'orientation ' => 'portrait ' ,
67- 'start_url ' => './phpBB / ' ,
68- 'scope ' => './phpBB / ' ,
58+ 'start_url ' => '/ ' ,
59+ 'scope ' => '/ ' ,
6960 ],
7061 ],
7162 'using script path ' => [
7263 [
7364 'force_server_vars ' => true ,
74- 'script_path ' => '/ ' ,
65+ 'script_path ' => '/foo/ ' ,
7566 'sitename ' => 'yourdomain.com ' ,
7667 'pwa_short_name ' => 'yourdomain ' ,
7768 ],
@@ -80,8 +71,8 @@ public function manifest_data()
8071 'short_name ' => 'yourdomain ' ,
8172 'display ' => 'standalone ' ,
8273 'orientation ' => 'portrait ' ,
83- 'start_url ' => '/ ' ,
84- 'scope ' => '/ ' ,
74+ 'start_url ' => '/foo/ ' ,
75+ 'scope ' => '/foo/ ' ,
8576 ],
8677 ],
8778 'with shortname ' => [
@@ -94,8 +85,8 @@ public function manifest_data()
9485 'short_name ' => 'testdomain ' ,
9586 'display ' => 'standalone ' ,
9687 'orientation ' => 'portrait ' ,
97- 'start_url ' => './phpBB / ' ,
98- 'scope ' => './phpBB / ' ,
88+ 'start_url ' => '/ ' ,
89+ 'scope ' => '/ ' ,
9990 ],
10091 ],
10192 'without shortname ' => [
@@ -108,8 +99,8 @@ public function manifest_data()
10899 'short_name ' => 'testdomain.c ' ,
109100 'display ' => 'standalone ' ,
110101 'orientation ' => 'portrait ' ,
111- 'start_url ' => './phpBB / ' ,
112- 'scope ' => './phpBB / ' ,
102+ 'start_url ' => '/ ' ,
103+ 'scope ' => '/ ' ,
113104 ],
114105 ],
115106 'with icons ' => [
@@ -124,8 +115,8 @@ public function manifest_data()
124115 'short_name ' => '' ,
125116 'display ' => 'standalone ' ,
126117 'orientation ' => 'portrait ' ,
127- 'start_url ' => './phpBB / ' ,
128- 'scope ' => './phpBB / ' ,
118+ 'start_url ' => '/ ' ,
119+ 'scope ' => '/ ' ,
129120 'icons ' => [
130121 [
131122 'src ' => 'http://images/site_icons/foo_sm.png ' ,
0 commit comments