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

@ -9,12 +9,11 @@ use Wallabag\ImportBundle\Command\ImportCommand;
class ImportCommandTest extends WallabagCoreTestCase
{
/**
* @expectedException \Symfony\Component\Console\Exception\RuntimeException
* @expectedExceptionMessage Not enough arguments
*/
public function testRunImportCommandWithoutArguments()
{
$this->expectException(\Symfony\Component\Console\Exception\RuntimeException::class);
$this->expectExceptionMessage('Not enough arguments');
$application = new Application($this->getClient()->getKernel());
$application->add(new ImportCommand());
@ -26,12 +25,11 @@ class ImportCommandTest extends WallabagCoreTestCase
]);
}
/**
* @expectedException \Symfony\Component\Config\Definition\Exception\Exception
* @expectedExceptionMessage not found
*/
public function testRunImportCommandWithoutFilepath()
{
$this->expectException(\Symfony\Component\Config\Definition\Exception\Exception::class);
$this->expectExceptionMessage('not found');
$application = new Application($this->getClient()->getKernel());
$application->add(new ImportCommand());
@ -45,11 +43,10 @@ class ImportCommandTest extends WallabagCoreTestCase
]);
}
/**
* @expectedException \Doctrine\ORM\NoResultException
*/
public function testRunImportCommandWithWrongUsername()
{
$this->expectException(\Doctrine\ORM\NoResultException::class);
$application = new Application($this->getClient()->getKernel());
$application->add(new ImportCommand());
@ -78,8 +75,8 @@ class ImportCommandTest extends WallabagCoreTestCase
'--importer' => 'v2',
]);
$this->assertContains('imported', $tester->getDisplay());
$this->assertContains('already saved', $tester->getDisplay());
$this->assertStringContainsString('imported', $tester->getDisplay());
$this->assertStringContainsString('already saved', $tester->getDisplay());
}
public function testRunImportCommandWithUserId()
@ -100,7 +97,7 @@ class ImportCommandTest extends WallabagCoreTestCase
'--importer' => 'v2',
]);
$this->assertContains('imported', $tester->getDisplay());
$this->assertContains('already saved', $tester->getDisplay());
$this->assertStringContainsString('imported', $tester->getDisplay());
$this->assertStringContainsString('already saved', $tester->getDisplay());
}
}

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());
}
}

View File

@ -80,7 +80,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.chrome'));
@ -108,7 +108,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -149,6 +149,6 @@ class ChromeControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -81,7 +81,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.elcurator'));
@ -109,7 +109,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')

View File

@ -80,7 +80,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.firefox'));
@ -108,7 +108,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -163,6 +163,6 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -13,7 +13,7 @@ class ImportControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('login', $client->getResponse()->headers->get('location'));
$this->assertStringContainsString('login', $client->getResponse()->headers->get('location'));
}
public function testImportList()

View File

@ -80,7 +80,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.instapaper'));
@ -108,7 +108,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -183,7 +183,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
}
public function testImportInstapaperWithEmptyFile()
@ -207,6 +207,6 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -80,7 +80,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.pinboard'));
@ -116,7 +116,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
);
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok');
@ -177,7 +177,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
}
public function testImportPinboardWithEmptyFile()
@ -201,6 +201,6 @@ class PinboardControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -77,7 +77,7 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/auth');
$this->assertSame(301, $client->getResponse()->getStatusCode());
$this->assertContains('getpocket.com/auth/authorize', $client->getResponse()->headers->get('location'));
$this->assertStringContainsString('getpocket.com/auth/authorize', $client->getResponse()->headers->get('location'));
}
public function testImportPocketCallbackWithBadToken()
@ -99,7 +99,7 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/callback');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
$this->assertStringContainsString('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
$this->assertSame('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
}
@ -133,7 +133,7 @@ class PocketControllerTest extends WallabagCoreTestCase
$client->request('GET', '/import/pocket/callback');
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertContains('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
$this->assertStringContainsString('/', $client->getResponse()->headers->get('location'), 'Import is ok, redirect to homepage');
$this->assertSame('flashes.import.notice.summary', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
}
}

View File

@ -80,7 +80,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.readability'));
@ -116,7 +116,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
);
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.20minutes.fr is ok');
@ -175,7 +175,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
}
public function testImportReadabilityWithEmptyFile()
@ -199,6 +199,6 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -81,7 +81,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.wallabag_v1'));
@ -117,7 +117,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
);
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
$this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is empty');
@ -176,7 +176,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
}
public function testImportWallabagWithEmptyFile()
@ -200,6 +200,6 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -81,7 +81,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.wallabag_v2'));
@ -109,7 +109,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -175,6 +175,6 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
$this->assertStringContainsString('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -90,7 +90,7 @@ class ChromeImportTest extends TestCase
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$res = $chromeImport->setMarkAsRead(true)->import();
@ -190,7 +190,7 @@ class ChromeImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('Wallabag Browser Import: unable to read file', $records[0]['message']);
$this->assertStringContainsString('Wallabag Browser Import: unable to read file', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -204,7 +204,7 @@ class ChromeImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('Wallabag Browser Import: user is not defined', $records[0]['message']);
$this->assertStringContainsString('Wallabag Browser Import: user is not defined', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}

View File

@ -90,7 +90,7 @@ class FirefoxImportTest extends TestCase
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$res = $firefoxImport->setMarkAsRead(true)->import();
@ -190,7 +190,7 @@ class FirefoxImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('Wallabag Browser Import: unable to read file', $records[0]['message']);
$this->assertStringContainsString('Wallabag Browser Import: unable to read file', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -204,7 +204,7 @@ class FirefoxImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('Wallabag Browser Import: user is not defined', $records[0]['message']);
$this->assertStringContainsString('Wallabag Browser Import: user is not defined', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}

View File

@ -91,7 +91,7 @@ class InstapaperImportTest extends TestCase
->expects($this->once())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$res = $instapaperImport->setMarkAsRead(true)->import();
@ -191,7 +191,7 @@ class InstapaperImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('InstapaperImport: unable to read file', $records[0]['message']);
$this->assertStringContainsString('InstapaperImport: unable to read file', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -205,7 +205,7 @@ class InstapaperImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('InstapaperImport: user is not defined', $records[0]['message']);
$this->assertStringContainsString('InstapaperImport: user is not defined', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}

View File

@ -60,7 +60,7 @@ class PocketImportTest extends TestCase
$this->assertFalse($code);
$records = $this->logHandler->getRecords();
$this->assertContains('PocketImport: Failed to request token', $records[0]['message']);
$this->assertStringContainsString('PocketImport: Failed to request token', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -91,7 +91,7 @@ class PocketImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('PocketImport: Failed to authorize client', $records[0]['message']);
$this->assertStringContainsString('PocketImport: Failed to authorize client', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -204,7 +204,7 @@ JSON
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived() && $persistedEntry->isStarred();
return (bool) $persistedEntry->isArchived() && (bool) $persistedEntry->isStarred();
}));
$entry = new Entry($this->user);
@ -295,7 +295,7 @@ JSON
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$entry = new Entry($this->user);
@ -491,7 +491,7 @@ JSON
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('PocketImport: Failed to import', $records[0]['message']);
$this->assertStringContainsString('PocketImport: Failed to import', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -511,7 +511,7 @@ JSON
}
}
}
JSON
));

View File

@ -90,7 +90,7 @@ class ReadabilityImportTest extends TestCase
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$res = $readabilityImport->setMarkAsRead(true)->import();
@ -190,7 +190,7 @@ class ReadabilityImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('ReadabilityImport: unable to read file', $records[0]['message']);
$this->assertStringContainsString('ReadabilityImport: unable to read file', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -204,7 +204,7 @@ class ReadabilityImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('ReadabilityImport: user is not defined', $records[0]['message']);
$this->assertStringContainsString('ReadabilityImport: user is not defined', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}

View File

@ -93,7 +93,7 @@ class WallabagV1ImportTest extends TestCase
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$res = $wallabagV1Import->setMarkAsRead(true)->import();
@ -193,7 +193,7 @@ class WallabagV1ImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('WallabagImport: unable to read file', $records[0]['message']);
$this->assertStringContainsString('WallabagImport: unable to read file', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -207,7 +207,7 @@ class WallabagV1ImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('WallabagImport: user is not defined', $records[0]['message']);
$this->assertStringContainsString('WallabagImport: user is not defined', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}

View File

@ -87,7 +87,7 @@ class WallabagV2ImportTest extends TestCase
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived();
return (bool) $persistedEntry->isArchived();
}));
$res = $wallabagV2Import->setMarkAsRead(true)->import();
@ -179,7 +179,7 @@ class WallabagV2ImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('WallabagImport: unable to read file', $records[0]['message']);
$this->assertStringContainsString('WallabagImport: unable to read file', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}
@ -193,7 +193,7 @@ class WallabagV2ImportTest extends TestCase
$this->assertFalse($res);
$records = $this->logHandler->getRecords();
$this->assertContains('WallabagImport: user is not defined', $records[0]['message']);
$this->assertStringContainsString('WallabagImport: user is not defined', $records[0]['message']);
$this->assertSame('ERROR', $records[0]['level_name']);
}