Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
phpbb_functional_manifest_test
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 test_manifest
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14/**
15* @group functional
16*/
17class phpbb_functional_manifest_test extends phpbb_functional_test_case
18{
19    public function test_manifest()
20    {
21        $url_path = preg_replace('#^(/.+)/$#', '$1/', parse_url(self::$root_url, PHP_URL_PATH));
22
23        $expected = [
24            'name'            => 'yourdomain.com',
25            'short_name'    => 'yourdomain',
26            'display'        => 'standalone',
27            'orientation'    => 'portrait',
28            'start_url'        => $url_path,
29            'scope'            => $url_path,
30        ];
31
32        $this->login();
33        $this->admin_login();
34
35        $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=settings&sid=' . $this->sid);
36
37        $form_data = [
38            'config[sitename]'        => $expected['name'],
39            'config[sitename_short]'    => $expected['short_name'],
40        ];
41        $form = $crawler->selectButton('submit')->form($form_data);
42        $crawler = self::submit($form);
43        $this->assertStringContainsString($this->lang('CONFIG_UPDATED'), $crawler->filter('.successbox')->text());
44
45        self::request('GET', 'app.php/manifest', [], false);
46        $this->assertEquals(json_encode($expected), self::get_content());
47    }
48}