Skip to content

Commit 88c95f4

Browse files
committed
Add missing checks to functional test
1 parent db1df9b commit 88c95f4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/functional/acp_file_test.php

+17
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ public function test_upload_invalid_extension()
110110

111111
public function test_upload_valid_file()
112112
{
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+
113117
$this->login();
114118
$this->admin_login();
115119

@@ -118,15 +122,24 @@ public function test_upload_valid_file()
118122
// Ensure there was no error message rendered
119123
$this->assertContainsLang('ACP_PWA_IMG_UPLOAD_SUCCESS', $crawler->text());
120124

125+
// Check icon appears in the ACP as expected
121126
$crawler = self::request('GET', 'adm/index.php?i=-phpbb-pwakit-acp-pwa_acp_module&mode=settings&sid=' . $this->sid);
122127
$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'));
123132
}
124133

125134
public function test_resync_delete_file()
126135
{
127136
// Manually copy image to site icon dir
128137
copy($this->path . 'bar.png', __DIR__ . '/../../../../../images/site_icons/bar.png');
129138

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+
130143
$this->login();
131144
$this->admin_login();
132145

@@ -139,6 +152,10 @@ public function test_resync_delete_file()
139152
$crawler = self::submit($form);
140153
$this->assertStringContainsString('bar.png', $crawler->filter('fieldset')->eq(2)->text());
141154

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+
142159
// Delete image
143160
$form = $crawler->selectButton('delete')->form(['delete' => 'bar.png']);
144161
$crawler = self::submit($form);

0 commit comments

Comments
 (0)