Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
28 / 28
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
phpbb_functions_validate_lang_iso_test
100.00% covered (success)
100.00%
28 / 28
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 getDataSet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setUp
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 test_validate_lang_iso
100.00% covered (success)
100.00%
24 / 24
100.00% covered (success)
100.00%
1 / 1
1
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
14require_once __DIR__ . '/../../phpBB/includes/functions_user.php';
15require_once __DIR__ . '/validate_data_helper.php';
16
17class phpbb_functions_validate_lang_iso_test extends phpbb_database_test_case
18{
19    protected $db;
20    protected $helper;
21
22    public function getDataSet()
23    {
24        return $this->createXMLDataSet(__DIR__ . '/fixtures/language_select.xml');
25    }
26
27    protected function setUp(): void
28    {
29        parent::setUp();
30
31        $this->db = $this->new_dbal();
32        $this->helper = new phpbb_functions_validate_data_helper($this);
33    }
34
35    public function test_validate_lang_iso()
36    {
37        global $db;
38
39        $db = $this->db;
40
41        $this->helper->assert_valid_data(array(
42            'empty' => array(
43                array('WRONG_DATA'),
44                '',
45                array('language_iso_name'),
46            ),
47            'en' => array(
48                array(),
49                'en',
50                array('language_iso_name'),
51            ),
52            'cs' => array(
53                array(),
54                'cs',
55                array('language_iso_name'),
56            ),
57            'de' => array(
58                array('WRONG_DATA'),
59                'de',
60                array('language_iso_name'),
61            ),
62        ));
63    }
64}