Move Import controllers to Core

This commit is contained in:
Yassine Guedidi
2023-12-31 12:25:57 +01:00
parent ed4b20f27f
commit 6787f598cb
60 changed files with 178 additions and 187 deletions

View File

@ -38,7 +38,7 @@ class ChromeImportTest extends TestCase
public function testImport()
{
$chromeImport = $this->getChromeImport(false, 1);
$chromeImport->setFilepath(__DIR__ . '/../fixtures/chrome-bookmarks');
$chromeImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/chrome-bookmarks');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -71,7 +71,7 @@ class ChromeImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$chromeImport = $this->getChromeImport(false, 1);
$chromeImport->setFilepath(__DIR__ . '/../fixtures/chrome-bookmarks');
$chromeImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/chrome-bookmarks');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -109,7 +109,7 @@ class ChromeImportTest extends TestCase
public function testImportWithRabbit()
{
$chromeImport = $this->getChromeImport();
$chromeImport->setFilepath(__DIR__ . '/../fixtures/chrome-bookmarks');
$chromeImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/chrome-bookmarks');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -149,7 +149,7 @@ class ChromeImportTest extends TestCase
public function testImportWithRedis()
{
$chromeImport = $this->getChromeImport();
$chromeImport->setFilepath(__DIR__ . '/../fixtures/chrome-bookmarks');
$chromeImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/chrome-bookmarks');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -189,7 +189,7 @@ class ChromeImportTest extends TestCase
public function testImportBadFile()
{
$chromeImport = $this->getChromeImport();
$chromeImport->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$chromeImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $chromeImport->import();
@ -203,7 +203,7 @@ class ChromeImportTest extends TestCase
public function testImportUserNotDefined()
{
$chromeImport = $this->getChromeImport(true);
$chromeImport->setFilepath(__DIR__ . '/../fixtures/chrome-bookmarks');
$chromeImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/chrome-bookmarks');
$res = $chromeImport->import();

View File

@ -38,7 +38,7 @@ class FirefoxImportTest extends TestCase
public function testImport()
{
$firefoxImport = $this->getFirefoxImport(false, 2);
$firefoxImport->setFilepath(__DIR__ . '/../fixtures/firefox-bookmarks.json');
$firefoxImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/firefox-bookmarks.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -71,7 +71,7 @@ class FirefoxImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$firefoxImport = $this->getFirefoxImport(false, 1);
$firefoxImport->setFilepath(__DIR__ . '/../fixtures/firefox-bookmarks.json');
$firefoxImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/firefox-bookmarks.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -109,7 +109,7 @@ class FirefoxImportTest extends TestCase
public function testImportWithRabbit()
{
$firefoxImport = $this->getFirefoxImport();
$firefoxImport->setFilepath(__DIR__ . '/../fixtures/firefox-bookmarks.json');
$firefoxImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/firefox-bookmarks.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -149,7 +149,7 @@ class FirefoxImportTest extends TestCase
public function testImportWithRedis()
{
$firefoxImport = $this->getFirefoxImport();
$firefoxImport->setFilepath(__DIR__ . '/../fixtures/firefox-bookmarks.json');
$firefoxImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/firefox-bookmarks.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -189,7 +189,7 @@ class FirefoxImportTest extends TestCase
public function testImportBadFile()
{
$firefoxImport = $this->getFirefoxImport();
$firefoxImport->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$firefoxImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $firefoxImport->import();
@ -203,7 +203,7 @@ class FirefoxImportTest extends TestCase
public function testImportUserNotDefined()
{
$firefoxImport = $this->getFirefoxImport(true);
$firefoxImport->setFilepath(__DIR__ . '/../fixtures/firefox-bookmarks.json');
$firefoxImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/firefox-bookmarks.json');
$res = $firefoxImport->import();

View File

@ -40,7 +40,7 @@ class InstapaperImportTest extends TestCase
public function testImport()
{
$instapaperImport = $this->getInstapaperImport(false, 4);
$instapaperImport->setFilepath(__DIR__ . '/../fixtures/instapaper-export.csv');
$instapaperImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/instapaper-export.csv');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -73,7 +73,7 @@ class InstapaperImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$instapaperImport = $this->getInstapaperImport(false, 1);
$instapaperImport->setFilepath(__DIR__ . '/../fixtures/instapaper-export.csv');
$instapaperImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/instapaper-export.csv');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -111,7 +111,7 @@ class InstapaperImportTest extends TestCase
public function testImportWithRabbit()
{
$instapaperImport = $this->getInstapaperImport();
$instapaperImport->setFilepath(__DIR__ . '/../fixtures/instapaper-export.csv');
$instapaperImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/instapaper-export.csv');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -151,7 +151,7 @@ class InstapaperImportTest extends TestCase
public function testImportWithRedis()
{
$instapaperImport = $this->getInstapaperImport();
$instapaperImport->setFilepath(__DIR__ . '/../fixtures/instapaper-export.csv');
$instapaperImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/instapaper-export.csv');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -191,7 +191,7 @@ class InstapaperImportTest extends TestCase
public function testImportBadFile()
{
$instapaperImport = $this->getInstapaperImport();
$instapaperImport->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$instapaperImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $instapaperImport->import();
@ -205,7 +205,7 @@ class InstapaperImportTest extends TestCase
public function testImportUserNotDefined()
{
$instapaperImport = $this->getInstapaperImport(true);
$instapaperImport->setFilepath(__DIR__ . '/../fixtures/instapaper-export.csv');
$instapaperImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/instapaper-export.csv');
$res = $instapaperImport->import();

View File

@ -38,7 +38,7 @@ class PocketHtmlImportTest extends TestCase
public function testImport()
{
$pocketHtmlImport = $this->getPocketHtmlImport(false, 2);
$pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/ril_export.html');
$pocketHtmlImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/ril_export.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -71,7 +71,7 @@ class PocketHtmlImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$pocketHtmlImport = $this->getPocketHtmlImport(false, 1);
$pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/ril_export.html');
$pocketHtmlImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/ril_export.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -111,7 +111,7 @@ class PocketHtmlImportTest extends TestCase
public function testImportWithRabbit()
{
$pocketHtmlImport = $this->getPocketHtmlImport();
$pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/ril_export.html');
$pocketHtmlImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/ril_export.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -151,7 +151,7 @@ class PocketHtmlImportTest extends TestCase
public function testImportWithRedis()
{
$pocketHtmlImport = $this->getPocketHtmlImport();
$pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/ril_export.html');
$pocketHtmlImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/ril_export.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -191,7 +191,7 @@ class PocketHtmlImportTest extends TestCase
public function testImportBadFile()
{
$pocketHtmlImport = $this->getPocketHtmlImport();
$pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$pocketHtmlImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $pocketHtmlImport->import();
@ -205,7 +205,7 @@ class PocketHtmlImportTest extends TestCase
public function testImportUserNotDefined()
{
$pocketHtmlImport = $this->getPocketHtmlImport(true);
$pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/ril_export.html');
$pocketHtmlImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/ril_export.html');
$res = $pocketHtmlImport->import();

View File

@ -38,7 +38,7 @@ class ReadabilityImportTest extends TestCase
public function testImport()
{
$readabilityImport = $this->getReadabilityImport(false, 3);
$readabilityImport->setFilepath(__DIR__ . '/../fixtures/readability.json');
$readabilityImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/readability.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -71,7 +71,7 @@ class ReadabilityImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$readabilityImport = $this->getReadabilityImport(false, 1);
$readabilityImport->setFilepath(__DIR__ . '/../fixtures/readability-read.json');
$readabilityImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/readability-read.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -109,7 +109,7 @@ class ReadabilityImportTest extends TestCase
public function testImportWithRabbit()
{
$readabilityImport = $this->getReadabilityImport();
$readabilityImport->setFilepath(__DIR__ . '/../fixtures/readability.json');
$readabilityImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/readability.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -149,7 +149,7 @@ class ReadabilityImportTest extends TestCase
public function testImportWithRedis()
{
$readabilityImport = $this->getReadabilityImport();
$readabilityImport->setFilepath(__DIR__ . '/../fixtures/readability.json');
$readabilityImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/readability.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -189,7 +189,7 @@ class ReadabilityImportTest extends TestCase
public function testImportBadFile()
{
$readabilityImport = $this->getReadabilityImport();
$readabilityImport->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$readabilityImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $readabilityImport->import();
@ -203,7 +203,7 @@ class ReadabilityImportTest extends TestCase
public function testImportUserNotDefined()
{
$readabilityImport = $this->getReadabilityImport(true);
$readabilityImport->setFilepath(__DIR__ . '/../fixtures/readability.json');
$readabilityImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/readability.json');
$res = $readabilityImport->import();

View File

@ -38,7 +38,7 @@ class ShaarliImportTest extends TestCase
public function testImport()
{
$shaarliImport = $this->getShaarliImport(false, 2);
$shaarliImport->setFilepath(__DIR__ . '/../fixtures/shaarli-bookmarks.html');
$shaarliImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/shaarli-bookmarks.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -71,7 +71,7 @@ class ShaarliImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$shaarliImport = $this->getShaarliImport(false, 1);
$shaarliImport->setFilepath(__DIR__ . '/../fixtures/shaarli-bookmarks.html');
$shaarliImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/shaarli-bookmarks.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -111,7 +111,7 @@ class ShaarliImportTest extends TestCase
public function testImportWithRabbit()
{
$shaarliImport = $this->getShaarliImport();
$shaarliImport->setFilepath(__DIR__ . '/../fixtures/shaarli-bookmarks.html');
$shaarliImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/shaarli-bookmarks.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -151,7 +151,7 @@ class ShaarliImportTest extends TestCase
public function testImportWithRedis()
{
$shaarliImport = $this->getShaarliImport();
$shaarliImport->setFilepath(__DIR__ . '/../fixtures/shaarli-bookmarks.html');
$shaarliImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/shaarli-bookmarks.html');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -191,7 +191,7 @@ class ShaarliImportTest extends TestCase
public function testImportBadFile()
{
$shaarliImport = $this->getShaarliImport();
$shaarliImport->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$shaarliImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $shaarliImport->import();
@ -205,7 +205,7 @@ class ShaarliImportTest extends TestCase
public function testImportUserNotDefined()
{
$shaarliImport = $this->getShaarliImport(true);
$shaarliImport->setFilepath(__DIR__ . '/../fixtures/shaarli-bookmarks.html');
$shaarliImport->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/shaarli-bookmarks.html');
$res = $shaarliImport->import();

View File

@ -42,7 +42,7 @@ class WallabagV1ImportTest extends TestCase
public function testImport()
{
$wallabagV1Import = $this->getWallabagV1Import(false, 1);
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.json');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -75,7 +75,7 @@ class WallabagV1ImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$wallabagV1Import = $this->getWallabagV1Import(false, 3);
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1-read.json');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1-read.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -113,7 +113,7 @@ class WallabagV1ImportTest extends TestCase
public function testImportWithRabbit()
{
$wallabagV1Import = $this->getWallabagV1Import();
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.json');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -153,7 +153,7 @@ class WallabagV1ImportTest extends TestCase
public function testImportWithRedis()
{
$wallabagV1Import = $this->getWallabagV1Import();
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.json');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -193,7 +193,7 @@ class WallabagV1ImportTest extends TestCase
public function testImportBadFile()
{
$wallabagV1Import = $this->getWallabagV1Import();
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.jsonx');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.jsonx');
$res = $wallabagV1Import->import();
@ -207,7 +207,7 @@ class WallabagV1ImportTest extends TestCase
public function testImportUserNotDefined()
{
$wallabagV1Import = $this->getWallabagV1Import(true);
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.json');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v1.json');
$res = $wallabagV1Import->import();

View File

@ -40,7 +40,7 @@ class WallabagV2ImportTest extends TestCase
public function testImport()
{
$wallabagV2Import = $this->getWallabagV2Import(false, 2);
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
$wallabagV2Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -69,7 +69,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportAndMarkAllAsRead()
{
$wallabagV2Import = $this->getWallabagV2Import(false, 2);
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2-read.json');
$wallabagV2Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2-read.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -107,7 +107,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportWithRabbit()
{
$wallabagV2Import = $this->getWallabagV2Import();
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
$wallabagV2Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -143,7 +143,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportWithRedis()
{
$wallabagV2Import = $this->getWallabagV2Import();
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
$wallabagV2Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()
@ -179,7 +179,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportBadFile()
{
$wallabagV1Import = $this->getWallabagV2Import();
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.jsonx');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2.jsonx');
$res = $wallabagV1Import->import();
@ -193,7 +193,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportUserNotDefined()
{
$wallabagV1Import = $this->getWallabagV2Import(true);
$wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
$wallabagV1Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2.json');
$res = $wallabagV1Import->import();
@ -207,7 +207,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportEmptyFile()
{
$wallabagV2Import = $this->getWallabagV2Import();
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2-empty.json');
$wallabagV2Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2-empty.json');
$res = $wallabagV2Import->import();
@ -218,7 +218,7 @@ class WallabagV2ImportTest extends TestCase
public function testImportWithExceptionFromGraby()
{
$wallabagV2Import = $this->getWallabagV2Import(false, 2);
$wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json');
$wallabagV2Import->setFilepath(__DIR__ . '/../../CoreBundle/fixtures/Import/wallabag-v2.json');
$entryRepo = $this->getMockBuilder(EntryRepository::class)
->disableOriginalConstructor()