diff options
| author | LEZY Thomas <thomas.gif.91@gmail.com> | 2014-05-29 17:40:57 +0200 |
|---|---|---|
| committer | LEZY Thomas <thomas.gif.91@gmail.com> | 2014-05-29 17:40:57 +0200 |
| commit | 2f2e404639bd0164387615a1f5c338cdbf9e2dfe (patch) | |
| tree | 3e92d6cadb7ac0afca02b2ca0f32a7fcd9ceea84 /tests/console | |
| parent | 335faafae8eb3304bd2f2e64f818cb014d50330a (diff) | |
| download | forums-2f2e404639bd0164387615a1f5c338cdbf9e2dfe.tar forums-2f2e404639bd0164387615a1f5c338cdbf9e2dfe.tar.gz forums-2f2e404639bd0164387615a1f5c338cdbf9e2dfe.tar.bz2 forums-2f2e404639bd0164387615a1f5c338cdbf9e2dfe.tar.xz forums-2f2e404639bd0164387615a1f5c338cdbf9e2dfe.zip | |
[ticket/12597] Fix test file
Fix bug of test_no_task that expected a message where none was supposed
to exist.
PHPBB3-12597
Diffstat (limited to 'tests/console')
| -rw-r--r-- | tests/console/cron/run_test.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php index e5cd170492..599d089a1f 100644 --- a/tests/console/cron/run_test.php +++ b/tests/console/cron/run_test.php @@ -61,6 +61,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $this->assertSame('', $command_tester->getDisplay()); $this->assertSame(true, $this->task->executed); $this->assertSame(0, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); } public function test_verbose_mode() @@ -71,6 +72,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); $this->assertSame(true, $this->task->executed); $this->assertSame(0, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); } public function test_error_lock() @@ -92,8 +94,22 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $command_tester = $this->get_command_tester(); $exit_status = $command_tester->execute(array('command' => $this->command_name)); + $this->assertSame('', $command_tester->getDisplay()); + $this->assertSame(0, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); + } + + public function test_no_task_verbose() + { + $tasks = array( + ); + $this->cron_manager = new \phpbb\cron\manager($tasks, $phpbb_root_path, $pathEx); + $command_tester = $this->get_command_tester(); + $exit_status = $command_tester->execute(array('command' => $this->command_name, '--verbose' => true)); + $this->assertContains('CRON_NO_TASK', $command_tester->getDisplay()); $this->assertSame(0, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); } public function test_arg_valid() @@ -104,6 +120,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $this->assertSame('', $command_tester->getDisplay()); $this->assertSame(true, $this->task->executed); $this->assertSame(0, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); } public function test_arg_invalid() @@ -114,6 +131,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $this->assertContains('CRON_NO_SUCH_TASK', $command_tester->getDisplay()); $this->assertSame(false, $this->task->executed); $this->assertSame(2, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); } public function test_arg_valid_verbose() @@ -124,6 +142,7 @@ class phpbb_console_command_cron_run_test extends phpbb_database_test_case $this->assertContains('RUNNING_TASK', $command_tester->getDisplay()); $this->assertSame(true, $this->task->executed); $this->assertSame(0, $exit_status); + $this->assertSame(false, $this->lock->owns_lock()); } public function get_command_tester() |
