From fe40b0d3a389c82a08af8095c351317f53fdd57d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 2 Jul 2024 21:53:45 -0700 Subject: [PATCH] [ticket/17363] Add functional test PHPBB-17363 Signed-off-by: Matt Friedman --- tests/functional/manifest_test.php | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/functional/manifest_test.php diff --git a/tests/functional/manifest_test.php b/tests/functional/manifest_test.php new file mode 100644 index 0000000000..f100d9bdff --- /dev/null +++ b/tests/functional/manifest_test.php @@ -0,0 +1,47 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +* @group functional +*/ +class phpbb_functional_manifest_test extends phpbb_functional_test_case +{ + public function test_manifest() + { + $expected = [ + 'name' => 'yourdomain.com', + 'short_name' => 'yourdomain', + 'display' => 'standalone', + 'orientation' => 'portrait', + 'dir' => 'ltr', + 'start_url' => '/', + 'scope' => '/', + ]; + + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=settings&sid=' . $this->sid); + + $form_data = [ + 'config[sitename]' => $expected['name'], + 'config[sitename_short]' => $expected['short_name'], + ]; + $form = $crawler->selectButton('submit')->form($form_data); + $crawler = self::submit($form); + $this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text()); + + self::request('GET', 'app.php/manifest', [], false); + $this->assertEquals(json_encode($expected), self::get_content()); + } +}