diff options
author | LEZY Thomas <thomas.gif.91@gmail.com> | 2014-05-28 14:39:02 +0200 |
---|---|---|
committer | LEZY Thomas <thomas.gif.91@gmail.com> | 2014-05-28 14:49:55 +0200 |
commit | 6f279c1bf47c4c86a507acc9ea7d705dad6e9b97 (patch) | |
tree | 6d2b5be8bbc1fd3bb8b42b87018bbe40d76f1bea | |
parent | 9761c1bf617763671308fabc569ec13d40cb6843 (diff) | |
download | forums-6f279c1bf47c4c86a507acc9ea7d705dad6e9b97.tar forums-6f279c1bf47c4c86a507acc9ea7d705dad6e9b97.tar.gz forums-6f279c1bf47c4c86a507acc9ea7d705dad6e9b97.tar.bz2 forums-6f279c1bf47c4c86a507acc9ea7d705dad6e9b97.tar.xz forums-6f279c1bf47c4c86a507acc9ea7d705dad6e9b97.zip |
[ticket/12597] Update pull-request
Removes a useless comment.
Switchs command name from cron:execute-all to cron:run-all.
Replaces assertEquals by assertSame
PHPBB3-12597
-rw-r--r-- | phpBB/config/console.yml | 4 | ||||
-rw-r--r-- | phpBB/cron.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/cron/run_all.php (renamed from phpBB/phpbb/console/command/cron/execute_all.php) | 4 | ||||
-rw-r--r-- | tests/console/cron/run_all_test.php (renamed from tests/console/cron/execute_all_test.php) | 18 |
4 files changed, 13 insertions, 14 deletions
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml index f268c2f05e..2aa89ee0cc 100644 --- a/phpBB/config/console.yml +++ b/phpBB/config/console.yml @@ -46,8 +46,8 @@ services: tags: - { name: console.command } - console.command.cron.execute_all: - class: phpbb\console\command\cron\execute_all + console.command.cron.run_all: + class: phpbb\console\command\cron\run_all arguments: - @cron.manager - @cron.lock_db diff --git a/phpBB/cron.php b/phpBB/cron.php index b35d16632a..0c1397979d 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -50,7 +50,6 @@ if ($cron_lock->acquire()) { $cron = $phpbb_container->get('cron.manager'); - // If invalid task is specified, empty $run_tasks is passed to do_cron which then does nothing $task = $cron->find_task($cron_type); if ($task) { diff --git a/phpBB/phpbb/console/command/cron/execute_all.php b/phpBB/phpbb/console/command/cron/run_all.php index f7157f4d3a..39b3e0c616 100644 --- a/phpBB/phpbb/console/command/cron/execute_all.php +++ b/phpBB/phpbb/console/command/cron/run_all.php @@ -12,7 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class execute_all extends \phpbb\console\command\command +class run_all extends \phpbb\console\command\command { /** @var \phpbb\cron\manager */ protected $cron_manager; @@ -47,7 +47,7 @@ class execute_all extends \phpbb\console\command\command protected function configure() { $this - ->setName('cron:execute-all') + ->setName('cron:run-all') ->setDescription($this->user->lang('CLI_DESCR_CRON_EXECUTE_ALL')) ; } diff --git a/tests/console/cron/execute_all_test.php b/tests/console/cron/run_all_test.php index 48ea79e29d..b718d1c117 100644 --- a/tests/console/cron/execute_all_test.php +++ b/tests/console/cron/run_all_test.php @@ -9,11 +9,11 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; -use phpbb\console\command\cron\execute_all; +use phpbb\console\command\cron\run_all; require_once dirname(__FILE__) . '/tasks/simple.php'; -class phpbb_console_command_cron_execute_all_test extends phpbb_database_test_case +class phpbb_console_command_cron_run_all_test extends phpbb_database_test_case { protected $db; protected $config; @@ -47,7 +47,7 @@ class phpbb_console_command_cron_execute_all_test extends phpbb_database_test_ca $cron_num_exec = 0; - $this->assertEquals('0', $config['cron_lock']); + $this->assertSame('0', $config['cron_lock']); } public function test_normal_use() @@ -57,8 +57,8 @@ class phpbb_console_command_cron_execute_all_test extends phpbb_database_test_ca $command_tester = $this->get_command_tester(); $command_tester->execute(array('command' => $this->command_name)); - $this->assertEquals('', $command_tester->getDisplay()); - $this->assertEquals(1, $cron_num_exec); + $this->assertSame('', $command_tester->getDisplay()); + $this->assertSame(1, $cron_num_exec); } public function test_verbose_mode() @@ -69,7 +69,7 @@ class phpbb_console_command_cron_execute_all_test extends phpbb_database_test_ca $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); $this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); - $this->assertEquals(1, $cron_num_exec); + $this->assertSame(1, $cron_num_exec); } public function test_error_lock() @@ -81,15 +81,15 @@ class phpbb_console_command_cron_execute_all_test extends phpbb_database_test_ca $command_tester->execute(array('command' => $this->command_name)); $this->assertContains('CRON_LOCK_ERROR', $command_tester->getDisplay()); - $this->assertEquals(0, $cron_num_exec); + $this->assertSame(0, $cron_num_exec); } public function get_command_tester() { $application = new Application(); - $application->add(new execute_all($this->cron_manager, $this->lock, $this->user)); + $application->add(new run_all($this->cron_manager, $this->lock, $this->user)); - $command = $application->find('cron:execute-all'); + $command = $application->find('cron:run-all'); $this->command_name = $command->getName(); return new CommandTester($command); } |