forked from wallabag/wallabag
Fix deprecated method in tests
This commit is contained in:
@ -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']);
|
||||
}
|
||||
|
||||
|
||||
@ -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']);
|
||||
}
|
||||
|
||||
|
||||
@ -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']);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
));
|
||||
|
||||
|
||||
@ -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']);
|
||||
}
|
||||
|
||||
|
||||
@ -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']);
|
||||
}
|
||||
|
||||
|
||||
@ -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']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user