Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
phpbb_functional_acp_main_test
0.00% covered (danger)
0.00%
0 / 30
0.00% covered (danger)
0.00%
0 / 2
20
0.00% covered (danger)
0.00%
0 / 1
 test_acp_database_size
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
 test_all_acp_module_links
0.00% covered (danger)
0.00%
0 / 22
0.00% covered (danger)
0.00%
0 / 1
12
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_main_test extends phpbb_functional_test_case
18{
19    public function test_acp_database_size()
20    {
21        $this->add_lang(['acp/common', 'acp/board']);
22        $this->login();
23        $this->admin_login();
24
25        $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid);
26        $this->assertContainsLang('WELCOME_PHPBB', $this->get_content());
27        $this->assertContainsLang('ADMIN_INTRO', $this->get_content());
28        $this->assertContainsLang('DATABASE_SIZE', $crawler->filter('tbody > tr')->eq(2)->filter('td[class="tabled"]')->eq(0)->text());
29        $this->assertNotContainsLang('NOT_AVAILABLE', $crawler->filter('tbody > tr')->eq(2)->filter('td[class="tabled"]')->eq(1)->text());
30    }
31
32    public function test_all_acp_module_links()
33    {
34        $this->add_lang('common');
35        $this->login();
36        $this->admin_login();
37
38        // Browse ACP main page
39        $crawler = self::request('GET', 'index.php');
40        $crawler = self::$client->click($crawler->selectLink($this->lang('ACP_SHORT'))->link());
41
42        // Get all ACP module URLs array
43        $acp_modules = $crawler->filter('.tabs a')->each(
44            function ($node, $i)
45            {
46                return $node->link();
47            }
48        );
49
50        // Browse all ACP modules and get their mode URLs array
51        $acp_submodules = [];
52        foreach ($acp_modules as $module)
53        {
54            $crawler = self::$client->click($module);
55            $acp_submodules = array_merge($acp_submodules, $crawler->filter('.menu-block > ul a')->each(
56                function ($node, $i)
57                {
58                    return $node->link();
59                }
60            ));
61        }
62
63        // Browse all ACP submodules' modes
64        foreach ($acp_submodules as $acp_submodule)
65        {
66            self::$client->click($acp_submodule);
67        }
68    }
69}