1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-22 12:16:11 +02:00
Files
php-phpbb/tests/dbal/migration/revert.php
Nicofuma 28176b0746 [ticket/12432] Adding unit test
PHPBB3-12432
2014-04-26 12:15:21 +02:00

49 lines
816 B
PHP

<?php
/**
*
* @package testing
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration
{
function update_schema()
{
return array(
'add_columns' => array(
'phpbb_config' => array(
'bar_column' => array('UINT', 1),
),
),
);
}
function revert_schema()
{
return array(
'drop_columns' => array(
'phpbb_config' => array(
'bar_column',
),
),
);
}
function update_data()
{
return array(
array('config.add', array('foobartest', 0)),
array('custom', array(array(&$this, 'my_custom_function'))),
);
}
function my_custom_function()
{
global $migrator_test_revert_counter;
$migrator_test_revert_counter += 1;
}
}