[ticket/13126] Fix tests

PHPBB3-13126
This commit is contained in:
Tristan Darricau 2014-10-20 19:59:36 +02:00
parent faf4b03c43
commit 981d3005f3
3 changed files with 11 additions and 12 deletions

View file

@ -14,7 +14,6 @@
namespace phpbb\console\command\db; namespace phpbb\console\command\db;
use phpbb\user; use phpbb\user;
use phpbb\db\migrator_output_handler;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class console_migrator_output_handler implements migrator_output_handler_interface class console_migrator_output_handler implements migrator_output_handler_interface

View file

@ -108,7 +108,7 @@ class migrator
* *
* @param migrator_output_handler $handler The output handler * @param migrator_output_handler $handler The output handler
*/ */
public function set_output_handler(migrator_output_handler $handler) public function set_output_handler(migrator_output_handler_interface $handler)
{ {
$this->output_handler = $handler; $this->output_handler = $handler;
} }
@ -182,7 +182,7 @@ class migrator
} }
else else
{ {
$this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_DEBUG); $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
} }
} }
} }
@ -198,7 +198,7 @@ class migrator
{ {
if (!class_exists($name)) if (!class_exists($name))
{ {
$this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler::VERBOSITY_DEBUG); $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
return false; return false;
} }
@ -217,7 +217,7 @@ class migrator
if (!empty($state['migration_depends_on'])) if (!empty($state['migration_depends_on']))
{ {
$this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler::VERBOSITY_DEBUG); $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
} }
foreach ($state['migration_depends_on'] as $depend) foreach ($state['migration_depends_on'] as $depend)
@ -257,7 +257,7 @@ class migrator
$this->last_run_migration['effectively_installed'] = true; $this->last_run_migration['effectively_installed'] = true;
$this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_VERBOSE); $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
} }
else else
{ {
@ -269,7 +269,7 @@ class migrator
if (!$state['migration_schema_done']) if (!$state['migration_schema_done'])
{ {
$this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERBOSE); $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
$this->last_run_migration['task'] = 'process_schema_step'; $this->last_run_migration['task'] = 'process_schema_step';
$elapsed_time = microtime(true); $elapsed_time = microtime(true);
@ -280,13 +280,13 @@ class migrator
$state['migration_data_state'] = ($result === true) ? '' : $result; $state['migration_data_state'] = ($result === true) ? '' : $result;
$state['migration_schema_done'] = ($result === true); $state['migration_schema_done'] = ($result === true);
$this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler::VERBOSITY_NORMAL); $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
} }
else if (!$state['migration_data_done']) else if (!$state['migration_data_done'])
{ {
try try
{ {
$this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERBOSE); $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
$this->last_run_migration['task'] = 'process_data_step'; $this->last_run_migration['task'] = 'process_data_step';
@ -300,11 +300,11 @@ class migrator
if ($state['migration_schema_done']) if ($state['migration_schema_done'])
{ {
$this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler::VERBOSITY_NORMAL); $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
} }
else else
{ {
$this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler::VERBOSITY_VERY_VERBOSE); $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE);
} }
} }
catch (\phpbb\db\migration\exception $e) catch (\phpbb\db\migration\exception $e)

View file

@ -13,7 +13,7 @@
namespace phpbb\db; namespace phpbb\db;
class null_migrator_output_handler class null_migrator_output_handler implements migrator_output_handler_interface
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}