@@ -110,6 +110,10 @@ public function test_upload_invalid_extension()
110
110
111
111
public function test_upload_valid_file ()
112
112
{
113
+ // Check icon does not yet appear in the html tags
114
+ $ crawler = self ::request ('GET ' , 'index.php ' );
115
+ $ this ->assertCount (0 , $ crawler ->filter ('link[rel="apple-touch-icon"] ' ));
116
+
113
117
$ this ->login ();
114
118
$ this ->admin_login ();
115
119
@@ -118,15 +122,24 @@ public function test_upload_valid_file()
118
122
// Ensure there was no error message rendered
119
123
$ this ->assertContainsLang ('ACP_PWA_IMG_UPLOAD_SUCCESS ' , $ crawler ->text ());
120
124
125
+ // Check icon appears in the ACP as expected
121
126
$ crawler = self ::request ('GET ' , 'adm/index.php?i=-phpbb-pwakit-acp-pwa_acp_module&mode=settings&sid= ' . $ this ->sid );
122
127
$ this ->assertStringContainsString ('foo.png ' , $ crawler ->filter ('fieldset ' )->eq (2 )->text ());
128
+
129
+ // Check icon appears in the html tags as expected
130
+ $ crawler = self ::request ('GET ' , 'index.php?sid= ' . $ this ->sid );
131
+ $ this ->assertStringContainsString ('foo.png ' , $ crawler ->filter ('link[rel="apple-touch-icon"] ' )->attr ('href ' ));
123
132
}
124
133
125
134
public function test_resync_delete_file ()
126
135
{
127
136
// Manually copy image to site icon dir
128
137
copy ($ this ->path . 'bar.png ' , __DIR__ . '/../../../../../images/site_icons/bar.png ' );
129
138
139
+ // Check icon does not yet appear in the html tags
140
+ $ crawler = self ::request ('GET ' , 'index.php ' );
141
+ $ this ->assertCount (0 , $ crawler ->filter ('link[rel="apple-touch-icon"] ' ));
142
+
130
143
$ this ->login ();
131
144
$ this ->admin_login ();
132
145
@@ -139,6 +152,10 @@ public function test_resync_delete_file()
139
152
$ crawler = self ::submit ($ form );
140
153
$ this ->assertStringContainsString ('bar.png ' , $ crawler ->filter ('fieldset ' )->eq (2 )->text ());
141
154
155
+ // Check icon appears in the html tags as expected
156
+ $ crawler = self ::request ('GET ' , 'index.php?sid= ' . $ this ->sid );
157
+ $ this ->assertStringContainsString ('bar.png ' , $ crawler ->filter ('link[rel="apple-touch-icon"] ' )->attr ('href ' ));
158
+
142
159
// Delete image
143
160
$ form = $ crawler ->selectButton ('delete ' )->form (['delete ' => 'bar.png ' ]);
144
161
$ crawler = self ::submit ($ form );
0 commit comments