Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
10.00% covered (danger)
10.00%
1 / 10
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
phpbb_regex_table_prefix_test
10.00% covered (danger)
10.00%
1 / 10
50.00% covered (danger)
50.00%
1 / 2
4.92
0.00% covered (danger)
0.00%
0 / 1
 table_prefix_test_data
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
2
 test_table_prefix
100.00% covered (success)
100.00%
1 / 1
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
14class phpbb_regex_table_prefix_test extends phpbb_test_case
15{
16    public static function table_prefix_test_data()
17    {
18        return array(
19            array('phpbb_', 1),
20            array('phpBB', 1),
21            array('a', 1),
22
23            array('', 0),
24            array('_', 0),
25            array('a-', 0),
26            array("'", 0),
27        );
28    }
29
30    /**
31    * @dataProvider table_prefix_test_data
32    */
33    public function test_table_prefix($prefix, $expected)
34    {
35        $this->assertEquals($expected, preg_match(get_preg_expression('table_prefix'), $prefix));
36    }
37}