Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
phpbb_functional_acp_users_test
0.00% covered (danger)
0.00%
0 / 17
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 setUp
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 test_founder_deletion
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 make_founder
0.00% covered (danger)
0.00%
0 / 6
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_acp_users_test extends phpbb_functional_test_case
18{
19    protected function setUp(): void
20    {
21        parent::setUp();
22
23        $this->login();
24        $this->admin_login();
25        $this->add_lang('acp/users');
26    }
27
28    public function test_founder_deletion()
29    {
30        $username = 'founder-account';
31        $user_id = $this->create_user($username);
32        $this->make_founder($user_id);
33
34        $crawler = self::request('GET', "adm/index.php?i=users&mode=overview&u=$user_id&sid={$this->sid}");
35        $form = $crawler->filter('#user_delete')->selectButton($this->lang('SUBMIT'))->form();
36        $crawler = self::submit($form);
37        $this->assertStringContainsString($this->lang('CANNOT_REMOVE_FOUNDER'), $this->get_content());
38    }
39
40    protected function make_founder($user_id)
41    {
42        $crawler = self::request('GET', "adm/index.php?i=users&mode=overview&u=$user_id&sid={$this->sid}");
43        $form = $crawler->filter('#user_overview')->selectButton($this->lang('SUBMIT'))->form();
44        $data = array('user_founder' => '1');
45        $form->setValues($data);
46        $crawler = self::submit($form);
47        $this->assertStringContainsString($this->lang('USER_OVERVIEW_UPDATED'), $this->get_content());
48    }
49}