Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
20 / 20
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
phpbb_dbal_migration_revert
100.00% covered (success)
100.00%
20 / 20
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 update_schema
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
 revert_schema
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
 update_data
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 my_custom_function
100.00% covered (success)
100.00%
2 / 2
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_dbal_migration_revert extends \phpbb\db\migration\migration
15{
16    function update_schema()
17    {
18        return array(
19            'add_columns' => array(
20                'phpbb_config' => array(
21                    'bar_column' => array('UINT', 1),
22                ),
23            ),
24        );
25    }
26
27    function revert_schema()
28    {
29        return array(
30            'drop_columns' => array(
31                'phpbb_config' => array(
32                    'bar_column',
33                ),
34            ),
35        );
36    }
37
38    function update_data()
39    {
40        return array(
41            array('config.add', array('foobartest', 0)),
42            array('custom', array(array(&$this, 'my_custom_function'))),
43        );
44    }
45
46    function my_custom_function()
47    {
48        global $migrator_test_revert_counter;
49
50        $migrator_test_revert_counter += 1;
51    }
52}