Fix deprecated method in tests

This commit is contained in:
Jeremy Benoist
2020-06-15 13:37:50 +02:00
parent 7332d1f4e5
commit 732ec8a2eb
44 changed files with 314 additions and 326 deletions

View File

@ -10,12 +10,11 @@ use Wallabag\ImportBundle\Command\RedisWorkerCommand;
class RedisWorkerCommandTest extends WallabagCoreTestCase
{
/**
* @expectedException \Symfony\Component\Console\Exception\RuntimeException
* @expectedExceptionMessage Not enough arguments (missing: "serviceName")
*/
public function testRunRedisWorkerCommandWithoutArguments()
{
$this->expectException(\Symfony\Component\Console\Exception\RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments (missing: "serviceName")');
$application = new Application($this->getClient()->getKernel());
$application->add(new RedisWorkerCommand());
@ -27,12 +26,11 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
]);
}
/**
* @expectedException \Symfony\Component\Config\Definition\Exception\Exception
* @expectedExceptionMessage No queue or consumer found for service name
*/
public function testRunRedisWorkerCommandWithBadService()
{
$this->expectException(\Symfony\Component\Config\Definition\Exception\Exception::class);
$this->expectExceptionMessage('No queue or consumer found for service name');
$application = new Application($this->getClient()->getKernel());
$application->add(new RedisWorkerCommand());
@ -68,7 +66,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
'--maxIterations' => 1,
]);
$this->assertContains('Worker started at', $tester->getDisplay());
$this->assertContains('Waiting for message', $tester->getDisplay());
$this->assertStringContainsString('Worker started at', $tester->getDisplay());
$this->assertStringContainsString('Waiting for message', $tester->getDisplay());
}
}