1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[ticket/16549] Move from assert[Not]Contains to assertString[Not]ContainsString

PHPBB3-16549
This commit is contained in:
rxu
2020-07-13 13:45:12 +07:00
parent 16d8698e1b
commit 58ea656fd8
49 changed files with 291 additions and 280 deletions

View File

@@ -44,19 +44,19 @@ class phpbb_console_command_cron_list_test extends phpbb_test_case
public function test_no_task()
{
$this->initiate_test(0, 0);
$this->assertContains('CRON_NO_TASKS', $this->command_tester->getDisplay());
$this->assertStringContainsString('CRON_NO_TASKS', $this->command_tester->getDisplay());
}
public function test_only_ready()
{
$this->initiate_test(2, 0);
$this->assertContains('TASKS_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
$this->assertStringContainsString('TASKS_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
}
public function test_only_not_ready()
{
$this->initiate_test(0, 2);
$this->assertContains('TASKS_NOT_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
$this->assertStringContainsString('TASKS_NOT_READY command1 command2', preg_replace('/[\s*=]+/', ' ', trim($this->command_tester->getDisplay())));
}
public function test_both_ready()

View File

@@ -103,7 +103,7 @@ 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, '--verbose' => true));
$this->assertContains('RUNNING_TASK', $command_tester->getDisplay());
$this->assertStringContainsString('RUNNING_TASK', $command_tester->getDisplay());
$this->assertSame(true, $this->task->executed);
$this->assertSame(0, $exit_status);
$this->assertSame(false, $this->lock->owns_lock());
@@ -119,7 +119,7 @@ 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->assertContains('CRON_LOCK_ERROR', $command_tester->getDisplay());
$this->assertStringContainsString('CRON_LOCK_ERROR', $command_tester->getDisplay());
$this->assertSame(false, $this->task->executed);
$this->assertSame(1, $exit_status);
}
@@ -215,7 +215,7 @@ 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, '--verbose' => true));
$this->assertContains('CRON_NO_TASK', $command_tester->getDisplay());
$this->assertStringContainsString('CRON_NO_TASK', $command_tester->getDisplay());
$this->assertSame(0, $exit_status);
$this->assertSame(false, $this->lock->owns_lock());
}
@@ -240,7 +240,7 @@ 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, 'name' => 'foo'));
$this->assertContains('CRON_NO_SUCH_TASK', $command_tester->getDisplay());
$this->assertStringContainsString('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());
@@ -251,7 +251,7 @@ 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, 'name' => 'phpbb_cron_task_simple', '--verbose' => true));
$this->assertContains('RUNNING_TASK', $command_tester->getDisplay());
$this->assertStringContainsString('RUNNING_TASK', $command_tester->getDisplay());
$this->assertSame(true, $this->task->executed);
$this->assertSame(0, $exit_status);
$this->assertSame(false, $this->lock->owns_lock());