diff --git a/app/AppKernel.php b/app/AppKernel.php index 9d942a2cd..216cacf29 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -38,10 +38,6 @@ class AppKernel extends Kernel // wallabag bundles new Wallabag\CoreBundle\WallabagCoreBundle(), - new Wallabag\ApiBundle\WallabagApiBundle(), - new Wallabag\UserBundle\WallabagUserBundle(), - new Wallabag\ImportBundle\WallabagImportBundle(), - new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/app/config/config.yml b/app/config/config.yml index e62a00990..6cd6557e6 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -160,7 +160,7 @@ nelmio_cors: fos_user: db_driver: orm firewall_name: secured_area - user_class: Wallabag\UserBundle\Entity\User + user_class: Wallabag\CoreBundle\Entity\User registration: confirmation: enabled: "%fosuser_confirmation%" @@ -168,14 +168,14 @@ fos_user: address: "%from_email%" sender_name: wallabag service: - mailer: Wallabag\UserBundle\Mailer\UserMailer + mailer: Wallabag\CoreBundle\Mailer\UserMailer fos_oauth_server: db_driver: orm - client_class: Wallabag\ApiBundle\Entity\Client - access_token_class: Wallabag\ApiBundle\Entity\AccessToken - refresh_token_class: Wallabag\ApiBundle\Entity\RefreshToken - auth_code_class: Wallabag\ApiBundle\Entity\AuthCode + client_class: Wallabag\CoreBundle\Entity\Api\Client + access_token_class: Wallabag\CoreBundle\Entity\Api\AccessToken + refresh_token_class: Wallabag\CoreBundle\Entity\Api\RefreshToken + auth_code_class: Wallabag\CoreBundle\Entity\Api\AuthCode service: user_provider: fos_user.user_provider.username_email options: @@ -194,14 +194,14 @@ scheb_two_factor: google: enabled: true issuer: "%server_name%" - template: "@WallabagUser/Authentication/form.html.twig" + template: "@WallabagCore/Authentication/form.html.twig" email: enabled: true sender_email: "%twofactor_sender%" digits: 6 - template: "@WallabagUser/Authentication/form.html.twig" - mailer: Wallabag\UserBundle\Mailer\AuthCodeMailer + template: "@WallabagCore/Authentication/form.html.twig" + mailer: Wallabag\CoreBundle\Mailer\AuthCodeMailer rulerz: targets: @@ -285,7 +285,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.pocket' - callback: wallabag_import.consumer.amqp.pocket + callback: wallabag_core.consumer.amqp.pocket qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_readability: connection: default @@ -294,7 +294,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.readability' - callback: wallabag_import.consumer.amqp.readability + callback: wallabag_core.consumer.amqp.readability qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_instapaper: connection: default @@ -303,7 +303,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.instapaper' - callback: wallabag_import.consumer.amqp.instapaper + callback: wallabag_core.consumer.amqp.instapaper qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_pinboard: connection: default @@ -312,7 +312,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.pinboard' - callback: wallabag_import.consumer.amqp.pinboard + callback: wallabag_core.consumer.amqp.pinboard qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_delicious: connection: default @@ -321,7 +321,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.delicious' - callback: wallabag_import.consumer.amqp.delicious + callback: wallabag_core.consumer.amqp.delicious qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_wallabag_v1: connection: default @@ -330,7 +330,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.wallabag_v1' - callback: wallabag_import.consumer.amqp.wallabag_v1 + callback: wallabag_core.consumer.amqp.wallabag_v1 qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_wallabag_v2: connection: default @@ -339,7 +339,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.wallabag_v2' - callback: wallabag_import.consumer.amqp.wallabag_v2 + callback: wallabag_core.consumer.amqp.wallabag_v2 qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_elcurator: connection: default @@ -348,7 +348,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.elcurator' - callback: wallabag_import.consumer.amqp.elcurator + callback: wallabag_core.consumer.amqp.elcurator qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_firefox: connection: default @@ -357,7 +357,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.firefox' - callback: wallabag_import.consumer.amqp.firefox + callback: wallabag_core.consumer.amqp.firefox qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_chrome: connection: default @@ -366,7 +366,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.chrome' - callback: wallabag_import.consumer.amqp.chrome + callback: wallabag_core.consumer.amqp.chrome qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_shaarli: connection: default @@ -375,7 +375,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.shaarli' - callback: wallabag_import.consumer.amqp.shaarli + callback: wallabag_core.consumer.amqp.shaarli qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_pocket_html: connection: default @@ -384,7 +384,7 @@ old_sound_rabbit_mq: type: topic queue_options: name: 'wallabag.import.pocket_html' - callback: wallabag_import.consumer.amqp.pocket_html + callback: wallabag_core.consumer.amqp.pocket_html qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} fos_js_routing: @@ -424,7 +424,7 @@ httplug: wallabag_core.entry.download_images: factory: 'httplug.factory.auto' plugins: ['httplug.plugin.logger'] - wallabag_import.pocket.client: + wallabag_core.pocket.client: factory: 'httplug.factory.auto' plugins: - 'httplug.plugin.logger' diff --git a/app/config/routing.yml b/app/config/routing.yml index 81fd63067..3cfaef516 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,23 +1,3 @@ -wallabag_annotation: - resource: "@WallabagAnnotationBundle/Controller/" - type: annotation - prefix: / - -wallabag_import: - resource: "@WallabagImportBundle/Controller/" - type: annotation - prefix: /import - -wallabag_user: - resource: "@WallabagUserBundle/Controller/" - type: annotation - prefix: /users - -wallabag_api: - resource: "@WallabagApiBundle/Controller/" - type: annotation - prefix: / - app: resource: "@WallabagCoreBundle/Controller/" type: annotation diff --git a/app/config/security.yml b/app/config/security.yml index 9ab516215..2c7bf8677 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -9,7 +9,7 @@ security: providers: administrators: entity: - class: 'Wallabag\UserBundle\Entity\User' + class: 'Wallabag\CoreBundle\Entity\User' property: username fos_userbundle: id: fos_user.user_provider.username_email diff --git a/app/config/services.yml b/app/config/services.yml index 06faebfd2..3e89e29df 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -32,108 +32,76 @@ services: $supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')' $fonts: '%wallabag_core.fonts%' - Wallabag\AnnotationBundle\: - resource: '../../src/Wallabag/AnnotationBundle/*' - exclude: '../../src/Wallabag/AnnotationBundle/{Controller,Entity,DataFixtures}' - - Wallabag\ApiBundle\: - resource: '../../src/Wallabag/ApiBundle/*' - exclude: '../../src/Wallabag/ApiBundle/{Controller,Entity}' - Wallabag\CoreBundle\: resource: '../../src/Wallabag/CoreBundle/*' - exclude: ['../../src/Wallabag/CoreBundle/{Controller,Entity,DataFixtures}', '../../src/Wallabag/CoreBundle/Event/*Event.php'] + exclude: ['../../src/Wallabag/CoreBundle/{Consumer,Controller,Entity,DataFixtures,Redis}', '../../src/Wallabag/CoreBundle/Event/*Event.php'] # controllers are imported separately to make sure services can be injected # as action arguments even if you don't extend any base controller class - Wallabag\AnnotationBundle\Controller\: - resource: '../../src/Wallabag/AnnotationBundle/Controller/' - tags: ['controller.service_arguments'] - - Wallabag\ApiBundle\Controller\: - resource: '../../src/Wallabag/ApiBundle/Controller/' - tags: ['controller.service_arguments'] - Wallabag\CoreBundle\Controller\: resource: '../../src/Wallabag/CoreBundle/Controller/' tags: ['controller.service_arguments'] - Wallabag\ImportBundle\Controller\: - resource: '../../src/Wallabag/ImportBundle/Controller/' - tags: ['controller.service_arguments'] - - Wallabag\UserBundle\Controller\: - resource: '../../src/Wallabag/UserBundle/Controller/' - tags: ['controller.service_arguments'] - # inject alias service into controllers - Wallabag\ImportBundle\Controller\ChromeController: + Wallabag\CoreBundle\Controller\Import\ChromeController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_chrome_producer' - $redisProducer: '@wallabag_import.producer.redis.chrome' + $redisProducer: '@wallabag_core.producer.redis.chrome' - Wallabag\ImportBundle\Controller\DeliciousController: + Wallabag\CoreBundle\Controller\Import\DeliciousController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_delicious_producer' - $redisProducer: '@wallabag_import.producer.redis.delicious' + $redisProducer: '@wallabag_core.producer.redis.delicious' - Wallabag\ImportBundle\Controller\ElcuratorController: + Wallabag\CoreBundle\Controller\Import\ElcuratorController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_elcurator_producer' - $redisProducer: '@wallabag_import.producer.redis.elcurator' + $redisProducer: '@wallabag_core.producer.redis.elcurator' - Wallabag\ImportBundle\Controller\FirefoxController: + Wallabag\CoreBundle\Controller\Import\FirefoxController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_firefox_producer' - $redisProducer: '@wallabag_import.producer.redis.firefox' + $redisProducer: '@wallabag_core.producer.redis.firefox' - Wallabag\ImportBundle\Controller\InstapaperController: + Wallabag\CoreBundle\Controller\Import\InstapaperController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_instapaper_producer' - $redisProducer: '@wallabag_import.producer.redis.instapaper' + $redisProducer: '@wallabag_core.producer.redis.instapaper' - Wallabag\ImportBundle\Controller\PinboardController: + Wallabag\CoreBundle\Controller\Import\PinboardController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_pinboard_producer' - $redisProducer: '@wallabag_import.producer.redis.pinboard' + $redisProducer: '@wallabag_core.producer.redis.pinboard' - Wallabag\ImportBundle\Controller\PocketController: + Wallabag\CoreBundle\Controller\Import\PocketController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_producer' - $redisProducer: '@wallabag_import.producer.redis.pocket' + $redisProducer: '@wallabag_core.producer.redis.pocket' - Wallabag\ImportBundle\Controller\ReadabilityController: + Wallabag\CoreBundle\Controller\Import\ReadabilityController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_readability_producer' - $redisProducer: '@wallabag_import.producer.redis.readability' + $redisProducer: '@wallabag_core.producer.redis.readability' - Wallabag\ImportBundle\Controller\WallabagV1Controller: + Wallabag\CoreBundle\Controller\Import\WallabagV1Controller: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v1_producer' - $redisProducer: '@wallabag_import.producer.redis.wallabag_v1' + $redisProducer: '@wallabag_core.producer.redis.wallabag_v1' - Wallabag\ImportBundle\Controller\WallabagV2Controller: + Wallabag\CoreBundle\Controller\Import\WallabagV2Controller: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer' - $redisProducer: '@wallabag_import.producer.redis.wallabag_v2' + $redisProducer: '@wallabag_core.producer.redis.wallabag_v2' - Wallabag\ImportBundle\Controller\ShaarliController: + Wallabag\CoreBundle\Controller\Import\ShaarliController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_shaarli_producer' - $redisProducer: '@wallabag_import.producer.redis.shaarli' + $redisProducer: '@wallabag_core.producer.redis.shaarli' - Wallabag\ImportBundle\Controller\PocketHtmlController: + Wallabag\CoreBundle\Controller\Import\PocketHtmlController: arguments: $rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_html_producer' - $redisProducer: '@wallabag_import.producer.redis.pocket_html' - - Wallabag\ImportBundle\: - resource: '../../src/Wallabag/ImportBundle/*' - exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}' - - Wallabag\UserBundle\: - resource: '../../src/Wallabag/UserBundle/*' - exclude: '../../src/Wallabag/UserBundle/{Controller,Entity,DataFixtures}' + $redisProducer: '@wallabag_core.producer.redis.pocket_html' Doctrine\DBAL\Connection: alias: doctrine.dbal.default_connection @@ -323,14 +291,14 @@ services: tags: - { name: console.command, command: 'wallabag:tag:all' } - Wallabag\ImportBundle\Command\ImportCommand: + Wallabag\CoreBundle\Command\Import\ImportCommand: tags: - { name: console.command, command: 'wallabag:import' } wallabag_core.entry.download_images.client: alias: 'httplug.client.wallabag_core.entry.download_images' - Wallabag\UserBundle\Mailer\UserMailer: + Wallabag\CoreBundle\Mailer\UserMailer: arguments: $parameters: template: @@ -340,7 +308,7 @@ services: confirmation: '%fos_user.registration.confirmation.from_email%' resetting: '%fos_user.resetting.email.from_email%' - Wallabag\UserBundle\EventListener\CreateConfigListener: + Wallabag\CoreBundle\Event\Listener\CreateConfigListener: arguments: $itemsOnPage: "%wallabag_core.items_on_page%" $feedLimit: "%wallabag_core.feed_limit%" @@ -350,62 +318,62 @@ services: $listMode: "%wallabag_core.list_mode%" $displayThumbnails: "%wallabag_core.display_thumbnails%" - Wallabag\UserBundle\EventListener\AuthenticationFailureListener: + Wallabag\CoreBundle\Event\Listener\AuthenticationFailureListener: tags: - { name: kernel.event_listener, event: security.authentication.failure, method: onAuthenticationFailure } - wallabag_import.pocket.client: - alias: 'httplug.client.wallabag_import.pocket.client' + wallabag_core.pocket.client: + alias: 'httplug.client.wallabag_core.pocket.client' - Wallabag\ImportBundle\Import\PocketImport: + Wallabag\CoreBundle\Import\PocketImport: calls: - - [ setClient, [ "@wallabag_import.pocket.client" ] ] + - [ setClient, [ "@wallabag_core.pocket.client" ] ] tags: - - { name: wallabag_import.import, alias: pocket } + - { name: wallabag_core.import, alias: pocket } - Wallabag\ImportBundle\Import\WallabagV1Import: + Wallabag\CoreBundle\Import\WallabagV1Import: tags: - - { name: wallabag_import.import, alias: wallabag_v1 } + - { name: wallabag_core.import, alias: wallabag_v1 } - Wallabag\ImportBundle\Import\WallabagV2Import: + Wallabag\CoreBundle\Import\WallabagV2Import: tags: - - { name: wallabag_import.import, alias: wallabag_v2 } + - { name: wallabag_core.import, alias: wallabag_v2 } - Wallabag\ImportBundle\Import\ElcuratorImport: + Wallabag\CoreBundle\Import\ElcuratorImport: tags: - - { name: wallabag_import.import, alias: elcurator } + - { name: wallabag_core.import, alias: elcurator } - Wallabag\ImportBundle\Import\ReadabilityImport: + Wallabag\CoreBundle\Import\ReadabilityImport: tags: - - { name: wallabag_import.import, alias: readability } + - { name: wallabag_core.import, alias: readability } - Wallabag\ImportBundle\Import\InstapaperImport: + Wallabag\CoreBundle\Import\InstapaperImport: tags: - - { name: wallabag_import.import, alias: instapaper } + - { name: wallabag_core.import, alias: instapaper } - Wallabag\ImportBundle\Import\PinboardImport: + Wallabag\CoreBundle\Import\PinboardImport: tags: - - { name: wallabag_import.import, alias: pinboard } + - { name: wallabag_core.import, alias: pinboard } - Wallabag\ImportBundle\Import\DeliciousImport: + Wallabag\CoreBundle\Import\DeliciousImport: tags: - - { name: wallabag_import.import, alias: delicious } + - { name: wallabag_core.import, alias: delicious } - Wallabag\ImportBundle\Import\FirefoxImport: + Wallabag\CoreBundle\Import\FirefoxImport: tags: - - { name: wallabag_import.import, alias: firefox } + - { name: wallabag_core.import, alias: firefox } - Wallabag\ImportBundle\Import\ChromeImport: + Wallabag\CoreBundle\Import\ChromeImport: tags: - - { name: wallabag_import.import, alias: chrome } + - { name: wallabag_core.import, alias: chrome } - Wallabag\ImportBundle\Import\ShaarliImport: + Wallabag\CoreBundle\Import\ShaarliImport: tags: - - { name: wallabag_import.import, alias: shaarli } + - { name: wallabag_core.import, alias: shaarli } - Wallabag\ImportBundle\Import\PocketHtmlImport: + Wallabag\CoreBundle\Import\PocketHtmlImport: tags: - - { name: wallabag_import.import, alias: pocket_html } + - { name: wallabag_core.import, alias: pocket_html } # to factorize the proximity and bypass translation for prev & next pagerfanta.view.default_wallabag: diff --git a/app/config/services_rabbit.yml b/app/config/services_rabbit.yml index 372323ab3..1a475370e 100644 --- a/app/config/services_rabbit.yml +++ b/app/config/services_rabbit.yml @@ -5,7 +5,7 @@ services: autoconfigure: true public: true - Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy: + Wallabag\CoreBundle\Consumer\RabbitMQConsumerTotalProxy: arguments: $pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer' $readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer' @@ -20,62 +20,62 @@ services: $shaarliConsumer: '@old_sound_rabbit_mq.import_shaarli_consumer' $pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer' - wallabag_import.consumer.amqp.pocket: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.pocket: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\PocketImport' + $import: '@Wallabag\CoreBundle\Import\PocketImport' - wallabag_import.consumer.amqp.readability: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.readability: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ReadabilityImport' + $import: '@Wallabag\CoreBundle\Import\ReadabilityImport' - wallabag_import.consumer.amqp.instapaper: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.instapaper: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\InstapaperImport' + $import: '@Wallabag\CoreBundle\Import\InstapaperImport' - wallabag_import.consumer.amqp.pinboard: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.pinboard: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\PinboardImport' + $import: '@Wallabag\CoreBundle\Import\PinboardImport' - wallabag_import.consumer.amqp.delicious: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.delicious: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\DeliciousImport' + $import: '@Wallabag\CoreBundle\Import\DeliciousImport' - wallabag_import.consumer.amqp.wallabag_v1: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.wallabag_v1: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\WallabagV1Import' + $import: '@Wallabag\CoreBundle\Import\WallabagV1Import' - wallabag_import.consumer.amqp.wallabag_v2: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.wallabag_v2: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\WallabagV2Import' + $import: '@Wallabag\CoreBundle\Import\WallabagV2Import' - wallabag_import.consumer.amqp.elcurator: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.elcurator: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ElcuratorImport' + $import: '@Wallabag\CoreBundle\Import\ElcuratorImport' - wallabag_import.consumer.amqp.firefox: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.firefox: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\FirefoxImport' + $import: '@Wallabag\CoreBundle\Import\FirefoxImport' - wallabag_import.consumer.amqp.chrome: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.chrome: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ChromeImport' + $import: '@Wallabag\CoreBundle\Import\ChromeImport' - wallabag_import.consumer.amqp.shaarli: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.shaarli: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ShaarliImport' + $import: '@Wallabag\CoreBundle\Import\ShaarliImport' - wallabag_import.consumer.amqp.pocket_html: - class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + wallabag_core.consumer.amqp.pocket_html: + class: Wallabag\CoreBundle\Consumer\AMQPEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\PocketHtmlImport' + $import: '@Wallabag\CoreBundle\Import\PocketHtmlImport' diff --git a/app/config/services_redis.yml b/app/config/services_redis.yml index 12e60f0bb..3f052b293 100644 --- a/app/config/services_redis.yml +++ b/app/config/services_redis.yml @@ -6,193 +6,193 @@ services: public: true # readability - wallabag_import.queue.redis.readability: + wallabag_core.queue.redis.readability: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.readability" - wallabag_import.producer.redis.readability: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.readability: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.readability" + - "@wallabag_core.queue.redis.readability" - wallabag_import.consumer.redis.readability: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.readability: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ReadabilityImport' + $import: '@Wallabag\CoreBundle\Import\ReadabilityImport' # instapaper - wallabag_import.queue.redis.instapaper: + wallabag_core.queue.redis.instapaper: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.instapaper" - wallabag_import.producer.redis.instapaper: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.instapaper: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.instapaper" + - "@wallabag_core.queue.redis.instapaper" - wallabag_import.consumer.redis.instapaper: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.instapaper: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\InstapaperImport' + $import: '@Wallabag\CoreBundle\Import\InstapaperImport' # pinboard - wallabag_import.queue.redis.pinboard: + wallabag_core.queue.redis.pinboard: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.pinboard" - wallabag_import.producer.redis.pinboard: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.pinboard: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.pinboard" + - "@wallabag_core.queue.redis.pinboard" - wallabag_import.consumer.redis.pinboard: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.pinboard: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\PinboardImport' + $import: '@Wallabag\CoreBundle\Import\PinboardImport' # delicious - wallabag_import.queue.redis.delicious: + wallabag_core.queue.redis.delicious: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.delicious" - wallabag_import.producer.redis.delicious: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.delicious: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.delicious" + - "@wallabag_core.queue.redis.delicious" - wallabag_import.consumer.redis.delicious: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.delicious: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\DeliciousImport' + $import: '@Wallabag\CoreBundle\Import\DeliciousImport' # pocket - wallabag_import.queue.redis.pocket: + wallabag_core.queue.redis.pocket: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.pocket" - wallabag_import.producer.redis.pocket: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.pocket: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.pocket" + - "@wallabag_core.queue.redis.pocket" - wallabag_import.consumer.redis.pocket: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.pocket: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\PocketImport' + $import: '@Wallabag\CoreBundle\Import\PocketImport' # wallabag v1 - wallabag_import.queue.redis.wallabag_v1: + wallabag_core.queue.redis.wallabag_v1: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.wallabag_v1" - wallabag_import.producer.redis.wallabag_v1: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.wallabag_v1: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.wallabag_v1" + - "@wallabag_core.queue.redis.wallabag_v1" - wallabag_import.consumer.redis.wallabag_v1: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.wallabag_v1: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\WallabagV1Import' + $import: '@Wallabag\CoreBundle\Import\WallabagV1Import' # wallabag v2 - wallabag_import.queue.redis.wallabag_v2: + wallabag_core.queue.redis.wallabag_v2: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.wallabag_v2" - wallabag_import.producer.redis.wallabag_v2: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.wallabag_v2: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.wallabag_v2" + - "@wallabag_core.queue.redis.wallabag_v2" - wallabag_import.consumer.redis.wallabag_v2: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.wallabag_v2: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\WallabagV2Import' + $import: '@Wallabag\CoreBundle\Import\WallabagV2Import' # elcurator - wallabag_import.queue.redis.elcurator: + wallabag_core.queue.redis.elcurator: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.elcurator" - wallabag_import.producer.redis.elcurator: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.elcurator: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.elcurator" + - "@wallabag_core.queue.redis.elcurator" - wallabag_import.consumer.redis.elcurator: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.elcurator: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ElcuratorImport' + $import: '@Wallabag\CoreBundle\Import\ElcuratorImport' # firefox - wallabag_import.queue.redis.firefox: + wallabag_core.queue.redis.firefox: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.firefox" - wallabag_import.producer.redis.firefox: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.firefox: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.firefox" + - "@wallabag_core.queue.redis.firefox" - wallabag_import.consumer.redis.firefox: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.firefox: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\FirefoxImport' + $import: '@Wallabag\CoreBundle\Import\FirefoxImport' # chrome - wallabag_import.queue.redis.chrome: + wallabag_core.queue.redis.chrome: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.chrome" - wallabag_import.producer.redis.chrome: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.chrome: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.chrome" + - "@wallabag_core.queue.redis.chrome" - wallabag_import.consumer.redis.chrome: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.chrome: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ChromeImport' + $import: '@Wallabag\CoreBundle\Import\ChromeImport' # shaarli - wallabag_import.queue.redis.shaarli: + wallabag_core.queue.redis.shaarli: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.shaarli" - wallabag_import.producer.redis.shaarli: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.shaarli: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.shaarli" + - "@wallabag_core.queue.redis.shaarli" - wallabag_import.consumer.redis.shaarli: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.shaarli: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\ShaarliImport' + $import: '@Wallabag\CoreBundle\Import\ShaarliImport' # pocket html - wallabag_import.queue.redis.pocket_html: + wallabag_core.queue.redis.pocket_html: class: Simpleue\Queue\RedisQueue arguments: $queueName: "wallabag.import.pocket_html" - wallabag_import.producer.redis.pocket_html: - class: Wallabag\ImportBundle\Redis\Producer + wallabag_core.producer.redis.pocket_html: + class: Wallabag\CoreBundle\Redis\Producer arguments: - - "@wallabag_import.queue.redis.pocket_html" + - "@wallabag_core.queue.redis.pocket_html" - wallabag_import.consumer.redis.pocket_html: - class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + wallabag_core.consumer.redis.pocket_html: + class: Wallabag\CoreBundle\Consumer\RedisEntryConsumer arguments: - $import: '@Wallabag\ImportBundle\Import\PocketHtmlImport' + $import: '@Wallabag\CoreBundle\Import\PocketHtmlImport' diff --git a/app/config/services_test.yml b/app/config/services_test.yml index 5073b64b9..749207ce8 100644 --- a/app/config/services_test.yml +++ b/app/config/services_test.yml @@ -13,7 +13,7 @@ services: public: true wallabag_user.user_repository.test: - alias: Wallabag\UserBundle\Repository\UserRepository + alias: Wallabag\CoreBundle\Repository\UserRepository public: true filesystem_cache: @@ -22,17 +22,7 @@ services: - "%kernel.cache_dir%/doctrine/metadata" # fixtures - Wallabag\UserBundle\DataFixtures\: - resource: '../../src/Wallabag/UserBundle/DataFixtures/*' - tags: ['doctrine.fixture.orm'] - autowire: true - Wallabag\CoreBundle\DataFixtures\: resource: '../../src/Wallabag/CoreBundle/DataFixtures/*' tags: ['doctrine.fixture.orm'] autowire: true - - Wallabag\AnnotationBundle\DataFixtures\: - resource: '../../src/Wallabag/AnnotationBundle/DataFixtures/*' - tags: ['doctrine.fixture.orm'] - autowire: true diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index ee4ba86f9..954fa7879 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -162,7 +162,5 @@ wallabag_core: - 'Montserrat' - 'OpenDyslexicRegular' - 'Oswald' - -wallabag_import: allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv', 'text/html'] resource_dir: "%kernel.project_dir%/web/uploads/import" diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index bb6e3ac10..9ebbc1c5f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,14 +1,14 @@ parameters: ignoreErrors: - - message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:postAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\\\.$#" + message: "#^Method Wallabag\\\\CoreBundle\\\\Controller\\\\AnnotationController\\:\\:postAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\\\.$#" count: 1 - path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php + path: src/Wallabag/CoreBundle/Controller/AnnotationController.php - - message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:putAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\\\.$#" + message: "#^Method Wallabag\\\\CoreBundle\\\\Controller\\\\AnnotationController\\:\\:putAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\\\.$#" count: 1 - path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php + path: src/Wallabag/CoreBundle/Controller/AnnotationController.php - message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#" @@ -20,6 +20,36 @@ parameters: count: 6 path: src/Wallabag/CoreBundle/Controller/ConfigController.php + - + message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" + count: 1 + path: src/Wallabag/CoreBundle/Controller/Import/BrowserController.php + + - + message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" + count: 1 + path: src/Wallabag/CoreBundle/Controller/Import/BrowserController.php + + - + message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" + count: 1 + path: src/Wallabag/CoreBundle/Controller/Import/HtmlController.php + + - + message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" + count: 1 + path: src/Wallabag/CoreBundle/Controller/Import/HtmlController.php + + - + message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" + count: 1 + path: src/Wallabag/CoreBundle/Controller/Import/WallabagController.php + + - + message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" + count: 1 + path: src/Wallabag/CoreBundle/Controller/Import/WallabagController.php + - message: "#^Call to an undefined method Spiriit\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#" count: 1 @@ -30,45 +60,15 @@ parameters: count: 10 path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php - - - message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" - count: 1 - path: src/Wallabag/ImportBundle/Controller/BrowserController.php - - - - message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" - count: 1 - path: src/Wallabag/ImportBundle/Controller/BrowserController.php - - - - message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" - count: 1 - path: src/Wallabag/ImportBundle/Controller/HtmlController.php - - - - message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" - count: 1 - path: src/Wallabag/ImportBundle/Controller/HtmlController.php - - - - message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" - count: 1 - path: src/Wallabag/ImportBundle/Controller/WallabagController.php - - - - message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" - count: 1 - path: src/Wallabag/ImportBundle/Controller/WallabagController.php - - message: "#^Call to an undefined method Scheb\\\\TwoFactorBundle\\\\Model\\\\Email\\\\TwoFactorInterface\\:\\:getName\\(\\)\\.$#" count: 2 - path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php + path: src/Wallabag/CoreBundle/Mailer/AuthCodeMailer.php - - message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\UserBundle\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#" + message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\CoreBundle\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#" count: 1 - path: src/Wallabag/UserBundle/Mailer/UserMailer.php + path: src/Wallabag/CoreBundle/Mailer/UserMailer.php - message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#" diff --git a/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php b/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php deleted file mode 100644 index bb1e03cf9..000000000 --- a/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,14 +0,0 @@ -processConfiguration($configuration, $configs); - } -} diff --git a/src/Wallabag/AnnotationBundle/WallabagAnnotationBundle.php b/src/Wallabag/AnnotationBundle/WallabagAnnotationBundle.php deleted file mode 100644 index b64920a33..000000000 --- a/src/Wallabag/AnnotationBundle/WallabagAnnotationBundle.php +++ /dev/null @@ -1,9 +0,0 @@ -processConfiguration($configuration, $configs); - } - - public function getAlias() - { - return 'wallabag_api'; - } -} diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml deleted file mode 100644 index de592c217..000000000 --- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml +++ /dev/null @@ -1,39 +0,0 @@ -entry: - type: rest - resource: 'Wallabag\ApiBundle\Controller\EntryRestController' - name_prefix: api_ - -search: - type: rest - resource: 'Wallabag\ApiBundle\Controller\SearchRestController' - name_prefix: api_ - -tag: - type: rest - resource: 'Wallabag\ApiBundle\Controller\TagRestController' - name_prefix: api_ - -tagging_rule: - type: rest - resource: 'Wallabag\ApiBundle\Controller\TaggingRuleRestController' - name_prefix: api_ - -annotation: - type: rest - resource: 'Wallabag\ApiBundle\Controller\AnnotationRestController' - name_prefix: api_ - -misc: - type: rest - resource: 'Wallabag\ApiBundle\Controller\WallabagRestController' - name_prefix: api_ - -user: - type: rest - resource: 'Wallabag\ApiBundle\Controller\UserRestController' - name_prefix: api_ - -config: - type: rest - resource: 'Wallabag\ApiBundle\Controller\ConfigRestController' - name_prefix: api_ diff --git a/src/Wallabag/ApiBundle/WallabagApiBundle.php b/src/Wallabag/ApiBundle/WallabagApiBundle.php deleted file mode 100644 index 19d887aba..000000000 --- a/src/Wallabag/ApiBundle/WallabagApiBundle.php +++ /dev/null @@ -1,9 +0,0 @@ -getArgument('serviceName'); - if (!$this->container->has('wallabag_import.queue.redis.' . $serviceName) || !$this->container->has('wallabag_import.consumer.redis.' . $serviceName)) { + if (!$this->container->has('wallabag_core.queue.redis.' . $serviceName) || !$this->container->has('wallabag_core.consumer.redis.' . $serviceName)) { throw new Exception(sprintf('No queue or consumer found for service name: "%s"', $input->getArgument('serviceName'))); } $worker = new QueueWorker( - $this->container->get('wallabag_import.queue.redis.' . $serviceName), - $this->container->get('wallabag_import.consumer.redis.' . $serviceName), + $this->container->get('wallabag_core.queue.redis.' . $serviceName), + $this->container->get('wallabag_core.consumer.redis.' . $serviceName), (int) $input->getOption('maxIterations') ); diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index a35cc08cd..877eedec3 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule; use Wallabag\CoreBundle\Entity\InternalSetting; -use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\User; class InstallCommand extends Command { diff --git a/src/Wallabag/CoreBundle/Command/ListUserCommand.php b/src/Wallabag/CoreBundle/Command/ListUserCommand.php index f4898c48c..3d1a23615 100644 --- a/src/Wallabag/CoreBundle/Command/ListUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ListUserCommand.php @@ -8,7 +8,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Wallabag\UserBundle\Repository\UserRepository; +use Wallabag\CoreBundle\Repository\UserRepository; class ListUserCommand extends Command { diff --git a/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php b/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php index b8357bbf2..96785940a 100644 --- a/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php +++ b/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Wallabag\CoreBundle\Event\EntrySavedEvent; use Wallabag\CoreBundle\Helper\ContentProxy; use Wallabag\CoreBundle\Repository\EntryRepository; -use Wallabag\UserBundle\Repository\UserRepository; +use Wallabag\CoreBundle\Repository\UserRepository; class ReloadEntryCommand extends Command { diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php index 61a882634..f01685e8b 100644 --- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php @@ -8,8 +8,8 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Wallabag\UserBundle\Entity\User; -use Wallabag\UserBundle\Repository\UserRepository; +use Wallabag\CoreBundle\Entity\User; +use Wallabag\CoreBundle\Repository\UserRepository; class ShowUserCommand extends Command { diff --git a/src/Wallabag/CoreBundle/Command/TagAllCommand.php b/src/Wallabag/CoreBundle/Command/TagAllCommand.php index 37f84fef9..05a2e56ae 100644 --- a/src/Wallabag/CoreBundle/Command/TagAllCommand.php +++ b/src/Wallabag/CoreBundle/Command/TagAllCommand.php @@ -9,9 +9,9 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Helper\RuleBasedTagger; -use Wallabag\UserBundle\Entity\User; -use Wallabag\UserBundle\Repository\UserRepository; +use Wallabag\CoreBundle\Repository\UserRepository; class TagAllCommand extends Command { diff --git a/src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php b/src/Wallabag/CoreBundle/Consumer/AMQPEntryConsumer.php similarity index 87% rename from src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php rename to src/Wallabag/CoreBundle/Consumer/AMQPEntryConsumer.php index be64bef0d..b6fc18760 100644 --- a/src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php +++ b/src/Wallabag/CoreBundle/Consumer/AMQPEntryConsumer.php @@ -1,6 +1,6 @@ validateAuthentication(); - return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::getAnnotationsAction', [ + return $this->forward('Wallabag\CoreBundle\Controller\AnnotationController::getAnnotationsAction', [ 'entry' => $entry, ]); } @@ -108,7 +108,7 @@ class AnnotationRestController extends WallabagRestController { $this->validateAuthentication(); - return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::postAnnotationAction', [ + return $this->forward('Wallabag\CoreBundle\Controller\AnnotationController::postAnnotationAction', [ 'request' => $request, 'entry' => $entry, ]); @@ -144,7 +144,7 @@ class AnnotationRestController extends WallabagRestController { $this->validateAuthentication(); - return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::putAnnotationAction', [ + return $this->forward('Wallabag\CoreBundle\Controller\AnnotationController::putAnnotationAction', [ 'annotation' => $annotation, 'request' => $request, ]); @@ -180,7 +180,7 @@ class AnnotationRestController extends WallabagRestController { $this->validateAuthentication(); - return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::deleteAnnotationAction', [ + return $this->forward('Wallabag\CoreBundle\Controller\AnnotationController::deleteAnnotationAction', [ 'annotation' => $annotation, ]); } diff --git a/src/Wallabag/ApiBundle/Controller/ConfigRestController.php b/src/Wallabag/CoreBundle/Controller/Api/ConfigRestController.php similarity index 96% rename from src/Wallabag/ApiBundle/Controller/ConfigRestController.php rename to src/Wallabag/CoreBundle/Controller/Api/ConfigRestController.php index 6539291ff..ec4d84b61 100644 --- a/src/Wallabag/ApiBundle/Controller/ConfigRestController.php +++ b/src/Wallabag/CoreBundle/Controller/Api/ConfigRestController.php @@ -1,6 +1,6 @@ get('mark_as_read')->getData(); $name = $this->getUser()->getId() . '.json'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $wallabag - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -51,7 +51,7 @@ abstract class BrowserController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); diff --git a/src/Wallabag/ImportBundle/Controller/ChromeController.php b/src/Wallabag/CoreBundle/Controller/Import/ChromeController.php similarity index 84% rename from src/Wallabag/ImportBundle/Controller/ChromeController.php rename to src/Wallabag/CoreBundle/Controller/Import/ChromeController.php index 08264d2de..61636f4ff 100644 --- a/src/Wallabag/ImportBundle/Controller/ChromeController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/ChromeController.php @@ -1,14 +1,14 @@ get('mark_as_read')->getData(); $name = 'delicious_' . $this->getUser()->getId() . '.json'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $delicious - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -65,7 +65,7 @@ class DeliciousController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); @@ -76,7 +76,7 @@ class DeliciousController extends AbstractController $this->addFlash('notice', 'flashes.import.notice.failed_on_file'); } - return $this->render('@WallabagImport/Delicious/index.html.twig', [ + return $this->render('@WallabagCore/Import/Delicious/index.html.twig', [ 'form' => $form->createView(), 'import' => $delicious, ]); diff --git a/src/Wallabag/ImportBundle/Controller/ElcuratorController.php b/src/Wallabag/CoreBundle/Controller/Import/ElcuratorController.php similarity index 83% rename from src/Wallabag/ImportBundle/Controller/ElcuratorController.php rename to src/Wallabag/CoreBundle/Controller/Import/ElcuratorController.php index acae64758..95b846ec9 100644 --- a/src/Wallabag/ImportBundle/Controller/ElcuratorController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/ElcuratorController.php @@ -1,14 +1,14 @@ get('mark_as_read')->getData(); $name = $this->getUser()->getId() . '.html'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $wallabag - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -51,7 +51,7 @@ abstract class HtmlController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/CoreBundle/Controller/Import/ImportController.php similarity index 89% rename from src/Wallabag/ImportBundle/Controller/ImportController.php rename to src/Wallabag/CoreBundle/Controller/Import/ImportController.php index afc57d690..8361f8240 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/ImportController.php @@ -1,14 +1,14 @@ render('@WallabagImport/Import/index.html.twig', [ + return $this->render('@WallabagCore/Import/index.html.twig', [ 'imports' => $importChain->getAll(), ]); } @@ -41,7 +41,7 @@ class ImportController extends AbstractController $rabbitNotInstalled = false; if (!$authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) { - return $this->render('@WallabagImport/Import/check_queue.html.twig'); + return $this->render('@WallabagCore/Import/check_queue.html.twig'); } if ($craueConfig->get('import_with_rabbitmq')) { @@ -85,7 +85,7 @@ class ImportController extends AbstractController } } - return $this->render('@WallabagImport/Import/check_queue.html.twig', [ + return $this->render('@WallabagCore/Import/check_queue.html.twig', [ 'nbRedisMessages' => $nbRedisMessages, 'nbRabbitMessages' => $nbRabbitMessages, 'redisNotInstalled' => $redisNotInstalled, diff --git a/src/Wallabag/ImportBundle/Controller/InstapaperController.php b/src/Wallabag/CoreBundle/Controller/Import/InstapaperController.php similarity index 81% rename from src/Wallabag/ImportBundle/Controller/InstapaperController.php rename to src/Wallabag/CoreBundle/Controller/Import/InstapaperController.php index 852f206a8..655784d22 100644 --- a/src/Wallabag/ImportBundle/Controller/InstapaperController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/InstapaperController.php @@ -1,6 +1,6 @@ get('mark_as_read')->getData(); $name = 'instapaper_' . $this->getUser()->getId() . '.csv'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $instapaper - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -65,7 +65,7 @@ class InstapaperController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); @@ -76,7 +76,7 @@ class InstapaperController extends AbstractController $this->addFlash('notice', 'flashes.import.notice.failed_on_file'); } - return $this->render('@WallabagImport/Instapaper/index.html.twig', [ + return $this->render('@WallabagCore/Import/Instapaper/index.html.twig', [ 'form' => $form->createView(), 'import' => $instapaper, ]); diff --git a/src/Wallabag/ImportBundle/Controller/PinboardController.php b/src/Wallabag/CoreBundle/Controller/Import/PinboardController.php similarity index 81% rename from src/Wallabag/ImportBundle/Controller/PinboardController.php rename to src/Wallabag/CoreBundle/Controller/Import/PinboardController.php index fe74675ca..2e39eff22 100644 --- a/src/Wallabag/ImportBundle/Controller/PinboardController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/PinboardController.php @@ -1,6 +1,6 @@ get('mark_as_read')->getData(); $name = 'pinboard_' . $this->getUser()->getId() . '.json'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $pinboard - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -65,7 +65,7 @@ class PinboardController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); @@ -76,7 +76,7 @@ class PinboardController extends AbstractController $this->addFlash('notice', 'flashes.import.notice.failed_on_file'); } - return $this->render('@WallabagImport/Pinboard/index.html.twig', [ + return $this->render('@WallabagCore/Import/Pinboard/index.html.twig', [ 'form' => $form->createView(), 'import' => $pinboard, ]); diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/CoreBundle/Controller/Import/PocketController.php similarity index 91% rename from src/Wallabag/ImportBundle/Controller/PocketController.php rename to src/Wallabag/CoreBundle/Controller/Import/PocketController.php index 4a9f6fd87..ba95d3874 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/PocketController.php @@ -1,6 +1,6 @@ getForm(); - return $this->render('@WallabagImport/Pocket/index.html.twig', [ + return $this->render('@WallabagCore/Import/Pocket/index.html.twig', [ 'import' => $pocket, 'has_consumer_key' => '' === trim($this->getUser()->getConfig()->getPocketConsumerKey()) ? false : true, 'form' => $form->createView(), @@ -51,7 +51,7 @@ class PocketController extends AbstractController } /** - * @Route("/pocket/auth", name="import_pocket_auth") + * @Route("/import/pocket/auth", name="import_pocket_auth") */ public function authAction(Request $request, PocketImport $pocketImport) { @@ -81,7 +81,7 @@ class PocketController extends AbstractController } /** - * @Route("/pocket/callback", name="import_pocket_callback") + * @Route("/import/pocket/callback", name="import_pocket_callback") */ public function callbackAction(PocketImport $pocketImport, TranslatorInterface $translator) { diff --git a/src/Wallabag/ImportBundle/Controller/PocketHtmlController.php b/src/Wallabag/CoreBundle/Controller/Import/PocketHtmlController.php similarity index 83% rename from src/Wallabag/ImportBundle/Controller/PocketHtmlController.php rename to src/Wallabag/CoreBundle/Controller/Import/PocketHtmlController.php index 825c167ed..2812202db 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketHtmlController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/PocketHtmlController.php @@ -1,14 +1,14 @@ get('mark_as_read')->getData(); $name = 'readability_' . $this->getUser()->getId() . '.json'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $readability - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -65,7 +65,7 @@ class ReadabilityController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); @@ -76,7 +76,7 @@ class ReadabilityController extends AbstractController $this->addFlash('notice', 'flashes.import.notice.failed_on_file'); } - return $this->render('@WallabagImport/Readability/index.html.twig', [ + return $this->render('@WallabagCore/Import/Readability/index.html.twig', [ 'form' => $form->createView(), 'import' => $readability, ]); diff --git a/src/Wallabag/ImportBundle/Controller/ShaarliController.php b/src/Wallabag/CoreBundle/Controller/Import/ShaarliController.php similarity index 84% rename from src/Wallabag/ImportBundle/Controller/ShaarliController.php rename to src/Wallabag/CoreBundle/Controller/Import/ShaarliController.php index 9d526be9f..52973042e 100644 --- a/src/Wallabag/ImportBundle/Controller/ShaarliController.php +++ b/src/Wallabag/CoreBundle/Controller/Import/ShaarliController.php @@ -1,14 +1,14 @@ get('mark_as_read')->getData(); $name = $this->getUser()->getId() . '.json'; - if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { + if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_core.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_core.resource_dir'), $name)) { $res = $wallabag - ->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name) + ->setFilepath($this->getParameter('wallabag_core.resource_dir') . '/' . $name) ->setMarkAsRead($markAsRead) ->import(); @@ -54,7 +54,7 @@ abstract class WallabagController extends AbstractController ]); } - unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name); + unlink($this->getParameter('wallabag_core.resource_dir') . '/' . $name); } $this->addFlash('notice', $message); diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/CoreBundle/Controller/Import/WallabagV1Controller.php similarity index 83% rename from src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php rename to src/Wallabag/CoreBundle/Controller/Import/WallabagV1Controller.php index ac7f1064e..bb2f8a9ae 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/CoreBundle/Controller/Import/WallabagV1Controller.php @@ -1,14 +1,14 @@ redirectToRoute('user_edit', ['id' => $user->getId()]); } - return $this->render('@WallabagUser/Manage/new.html.twig', [ + return $this->render('@WallabagCore/User/new.html.twig', [ 'user' => $user, 'form' => $form->createView(), ]); @@ -77,7 +76,7 @@ class ManageController extends AbstractController /** * Displays a form to edit an existing User entity. * - * @Route("/{id}/edit", name="user_edit", methods={"GET", "POST"}) + * @Route("/users/{id}/edit", name="user_edit", methods={"GET", "POST"}) */ public function editAction(Request $request, User $user, UserManagerInterface $userManager, GoogleAuthenticatorInterface $googleAuthenticator) { @@ -109,7 +108,7 @@ class ManageController extends AbstractController return $this->redirectToRoute('user_edit', ['id' => $user->getId()]); } - return $this->render('@WallabagUser/Manage/edit.html.twig', [ + return $this->render('@WallabagCore/User/edit.html.twig', [ 'user' => $user, 'edit_form' => $form->createView(), 'delete_form' => $deleteForm->createView(), @@ -119,7 +118,7 @@ class ManageController extends AbstractController /** * Deletes a User entity. * - * @Route("/{id}", name="user_delete", methods={"DELETE"}) + * @Route("/users/{id}", name="user_delete", methods={"DELETE"}) */ public function deleteAction(Request $request, User $user) { @@ -142,7 +141,7 @@ class ManageController extends AbstractController /** * @param int $page * - * @Route("/list/{page}", name="user_index", defaults={"page" = 1}) + * @Route("/users/list/{page}", name="user_index", defaults={"page" = 1}) * * Default parameter for page is hardcoded (in duplication of the defaults from the Route) * because this controller is also called inside the layout template without any page as argument @@ -174,7 +173,7 @@ class ManageController extends AbstractController } } - return $this->render('@WallabagUser/Manage/index.html.twig', [ + return $this->render('@WallabagCore/User/index.html.twig', [ 'searchForm' => $form->createView(), 'users' => $pagerFanta, ]); diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/AnnotationFixtures.php similarity index 87% rename from src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php rename to src/Wallabag/CoreBundle/DataFixtures/AnnotationFixtures.php index a2de49e6a..aba2c1d5a 100644 --- a/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/AnnotationFixtures.php @@ -1,15 +1,13 @@ arrayNode('fonts') ->prototype('scalar')->end() ->end() + ->arrayNode('allow_mimetypes') + ->prototype('scalar')->end() + ->end() + ->scalarNode('resource_dir') + ->end() ->end() ; diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index 155f05372..754931681 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -30,6 +30,8 @@ class WallabagCoreExtension extends Extension $container->setParameter('wallabag_core.site_credentials.encryption_key_path', $config['encryption_key_path']); $container->setParameter('wallabag_core.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']); $container->setParameter('wallabag_core.fonts', $config['fonts']); + $container->setParameter('wallabag_core.allow_mimetypes', $config['allow_mimetypes']); + $container->setParameter('wallabag_core.resource_dir', $config['resource_dir']); } public function getAlias() diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/CoreBundle/Entity/Annotation.php similarity index 94% rename from src/Wallabag/AnnotationBundle/Entity/Annotation.php rename to src/Wallabag/CoreBundle/Entity/Annotation.php index a180d5047..bda05642b 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/CoreBundle/Entity/Annotation.php @@ -1,6 +1,6 @@ + * @var ArrayCollection&iterable<\Wallabag\CoreBundle\Entity\Api\Client> * - * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"}) + * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\Api\Client", mappedBy="user", cascade={"remove"}) */ protected $clients; diff --git a/src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php b/src/Wallabag/CoreBundle/Event/Listener/AuthenticationFailureListener.php similarity index 96% rename from src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php rename to src/Wallabag/CoreBundle/Event/Listener/AuthenticationFailureListener.php index 20fbd2a7f..fefd700ed 100644 --- a/src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php +++ b/src/Wallabag/CoreBundle/Event/Listener/AuthenticationFailureListener.php @@ -1,6 +1,6 @@ findTaggedServiceIds( - 'wallabag_import.import' + 'wallabag_core.import' ); foreach ($taggedServices as $id => $tagAttributes) { foreach ($tagAttributes as $attributes) { diff --git a/src/Wallabag/ImportBundle/Import/ImportInterface.php b/src/Wallabag/CoreBundle/Import/ImportInterface.php similarity index 94% rename from src/Wallabag/ImportBundle/Import/ImportInterface.php rename to src/Wallabag/CoreBundle/Import/ImportInterface.php index 25dc0d857..86df25b7e 100644 --- a/src/Wallabag/ImportBundle/Import/ImportInterface.php +++ b/src/Wallabag/CoreBundle/Import/ImportInterface.php @@ -1,6 +1,6 @@ twig->load('@WallabagUser/TwoFactor/email_auth_code.html.twig'); + $template = $this->twig->load('@WallabagCore/TwoFactor/email_auth_code.html.twig'); $subject = $template->renderBlock('subject', []); $bodyHtml = $template->renderBlock('body_html', [ diff --git a/src/Wallabag/UserBundle/Mailer/UserMailer.php b/src/Wallabag/CoreBundle/Mailer/UserMailer.php similarity index 98% rename from src/Wallabag/UserBundle/Mailer/UserMailer.php rename to src/Wallabag/CoreBundle/Mailer/UserMailer.php index 34f13e0c4..6d1f2f133 100644 --- a/src/Wallabag/UserBundle/Mailer/UserMailer.php +++ b/src/Wallabag/CoreBundle/Mailer/UserMailer.php @@ -1,6 +1,6 @@ registry->getManagerForClass($configuration->getClass()); // Check, if class name is what we need - if (null !== $em && 'Wallabag\UserBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) { + if (null !== $em && 'Wallabag\CoreBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) { return false; } diff --git a/src/Wallabag/ImportBundle/Redis/Producer.php b/src/Wallabag/CoreBundle/Redis/Producer.php similarity index 96% rename from src/Wallabag/ImportBundle/Redis/Producer.php rename to src/Wallabag/CoreBundle/Redis/Producer.php index c77b51747..fbab0265a 100644 --- a/src/Wallabag/ImportBundle/Redis/Producer.php +++ b/src/Wallabag/CoreBundle/Redis/Producer.php @@ -1,6 +1,6 @@ getEntityManager() - ->createQuery('DELETE FROM Wallabag\AnnotationBundle\Entity\Annotation a WHERE a.user = :userId') + ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Annotation a WHERE a.user = :userId') ->setParameter('userId', $userId) ->execute(); } diff --git a/src/Wallabag/ApiBundle/Repository/ClientRepository.php b/src/Wallabag/CoreBundle/Repository/Api/ClientRepository.php similarity index 89% rename from src/Wallabag/ApiBundle/Repository/ClientRepository.php rename to src/Wallabag/CoreBundle/Repository/Api/ClientRepository.php index 0c0b79786..b991207e2 100644 --- a/src/Wallabag/ApiBundle/Repository/ClientRepository.php +++ b/src/Wallabag/CoreBundle/Repository/Api/ClientRepository.php @@ -1,10 +1,10 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans|raw }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Delicious/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Delicious/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/Delicious/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Delicious/index.html.twig index 8e5741c45..f4a80d19d 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Delicious/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Delicious/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Elcurator/index.html.twig similarity index 53% rename from src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Elcurator/index.html.twig index 2d950c95c..092df335a 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Elcurator/index.html.twig @@ -1,3 +1,3 @@ -{% extends "@WallabagImport/WallabagV1/index.html.twig" %} +{% extends "@WallabagCore/Import/WallabagV1/index.html.twig" %} {% block title %}{{ 'import.elcurator.page_title'|trans }}{% endblock %} diff --git a/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Firefox/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Firefox/index.html.twig index e262da8a6..9ba162411 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Firefox/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Firefox/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans|raw }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Instapaper/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Instapaper/index.html.twig index 38f5eeda6..78cd7ffe3 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Instapaper/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Instapaper/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Pinboard/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Pinboard/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/Pinboard/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Pinboard/index.html.twig index 9c79e088c..60e9c3618 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Pinboard/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Pinboard/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Pocket/index.html.twig similarity index 95% rename from src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Pocket/index.html.twig index 781b873e1..c015c06fb 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Pocket/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Pocket/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %} {% if not has_consumer_key %}
diff --git a/src/Wallabag/ImportBundle/Resources/views/PocketHtml/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/PocketHtml/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/PocketHtml/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/PocketHtml/index.html.twig index 09f2e689f..b2daf7852 100644 --- a/src/Wallabag/ImportBundle/Resources/views/PocketHtml/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/PocketHtml/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans|raw }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Readability/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Readability/index.html.twig index 70eceb103..5e362d8db 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Readability/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Readability/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/Shaarli/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/Shaarli/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/Shaarli/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/Shaarli/index.html.twig index edb24e468..cbf54ff87 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Shaarli/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/Shaarli/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans|raw }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/WallabagV1/index.html.twig similarity index 96% rename from src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/WallabagV1/index.html.twig index 6e0598afa..c70a27c15 100644 --- a/src/Wallabag/ImportBundle/Resources/views/WallabagV1/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/WallabagV1/index.html.twig @@ -6,7 +6,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %}
{{ import.description|trans }}
diff --git a/src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/WallabagV2/index.html.twig similarity index 54% rename from src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/WallabagV2/index.html.twig index 2521578c8..26b6c253c 100644 --- a/src/Wallabag/ImportBundle/Resources/views/WallabagV2/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/WallabagV2/index.html.twig @@ -1,3 +1,3 @@ -{% extends "@WallabagImport/WallabagV1/index.html.twig" %} +{% extends "@WallabagCore/Import/WallabagV1/index.html.twig" %} {% block title %}{{ 'import.wallabag_v2.page_title'|trans }}{% endblock %} diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/_information.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/_information.html.twig similarity index 100% rename from src/Wallabag/ImportBundle/Resources/views/Import/_information.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/_information.html.twig diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/check_queue.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/check_queue.html.twig similarity index 100% rename from src/Wallabag/ImportBundle/Resources/views/Import/check_queue.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/check_queue.html.twig diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/Import/index.html.twig similarity index 81% rename from src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Import/index.html.twig index 6903a5fd4..2654709d0 100644 --- a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Import/index.html.twig @@ -3,7 +3,7 @@ {% block title %}{{ 'import.page_title'|trans }}{% endblock %} {% block messages %} - {{ render(controller('Wallabag\\ImportBundle\\Controller\\ImportController::checkQueueAction')) }} + {{ render(controller('Wallabag\\CoreBundle\\Controller\\Import\\ImportController::checkQueueAction')) }} {{ parent() }} {% endblock %} @@ -12,7 +12,7 @@
- {% include '@WallabagImport/Import/_information.html.twig' %} + {% include '@WallabagCore/Import/_information.html.twig' %} {{ 'import.page_description'|trans }}
    diff --git a/src/Wallabag/UserBundle/Resources/views/Resetting/passwordAlreadyRequested.html.twig b/src/Wallabag/CoreBundle/Resources/views/Resetting/passwordAlreadyRequested.html.twig similarity index 100% rename from src/Wallabag/UserBundle/Resources/views/Resetting/passwordAlreadyRequested.html.twig rename to src/Wallabag/CoreBundle/Resources/views/Resetting/passwordAlreadyRequested.html.twig diff --git a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig b/src/Wallabag/CoreBundle/Resources/views/TwoFactor/email_auth_code.html.twig similarity index 100% rename from src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig rename to src/Wallabag/CoreBundle/Resources/views/TwoFactor/email_auth_code.html.twig diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig b/src/Wallabag/CoreBundle/Resources/views/User/edit.html.twig similarity index 100% rename from src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig rename to src/Wallabag/CoreBundle/Resources/views/User/edit.html.twig diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/User/index.html.twig similarity index 100% rename from src/Wallabag/UserBundle/Resources/views/Manage/index.html.twig rename to src/Wallabag/CoreBundle/Resources/views/User/index.html.twig diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/new.html.twig b/src/Wallabag/CoreBundle/Resources/views/User/new.html.twig similarity index 100% rename from src/Wallabag/UserBundle/Resources/views/Manage/new.html.twig rename to src/Wallabag/CoreBundle/Resources/views/User/new.html.twig diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index e7a52680c..87135f5c6 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -8,9 +8,9 @@ use Twig\Extension\AbstractExtension; use Twig\Extension\GlobalsInterface; use Twig\TwigFilter; use Twig\TwigFunction; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Repository\EntryRepository; use Wallabag\CoreBundle\Repository\TagRepository; -use Wallabag\UserBundle\Entity\User; class WallabagExtension extends AbstractExtension implements GlobalsInterface { diff --git a/src/Wallabag/CoreBundle/WallabagCoreBundle.php b/src/Wallabag/CoreBundle/WallabagCoreBundle.php index f5899e39c..e6fae41a1 100644 --- a/src/Wallabag/CoreBundle/WallabagCoreBundle.php +++ b/src/Wallabag/CoreBundle/WallabagCoreBundle.php @@ -2,8 +2,16 @@ namespace Wallabag\CoreBundle; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; +use Wallabag\CoreBundle\Import\ImportCompilerPass; class WallabagCoreBundle extends Bundle { + public function build(ContainerBuilder $container) + { + parent::build($container); + + $container->addCompilerPass(new ImportCompilerPass()); + } } diff --git a/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php b/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php deleted file mode 100644 index 3694c863e..000000000 --- a/src/Wallabag/ImportBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,27 +0,0 @@ -getRootNode(); - - $rootNode - ->children() - ->arrayNode('allow_mimetypes') - ->prototype('scalar')->end() - ->end() - ->scalarNode('resource_dir') - ->end() - ->end() - ; - - return $treeBuilder; - } -} diff --git a/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php b/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php deleted file mode 100644 index 2aa7d26fa..000000000 --- a/src/Wallabag/ImportBundle/DependencyInjection/WallabagImportExtension.php +++ /dev/null @@ -1,22 +0,0 @@ -processConfiguration($configuration, $configs); - $container->setParameter('wallabag_import.allow_mimetypes', $config['allow_mimetypes']); - $container->setParameter('wallabag_import.resource_dir', $config['resource_dir']); - } - - public function getAlias() - { - return 'wallabag_import'; - } -} diff --git a/src/Wallabag/ImportBundle/WallabagImportBundle.php b/src/Wallabag/ImportBundle/WallabagImportBundle.php deleted file mode 100644 index 98c2f97b4..000000000 --- a/src/Wallabag/ImportBundle/WallabagImportBundle.php +++ /dev/null @@ -1,17 +0,0 @@ -addCompilerPass(new ImportCompilerPass()); - } -} diff --git a/src/Wallabag/UserBundle/DependencyInjection/Configuration.php b/src/Wallabag/UserBundle/DependencyInjection/Configuration.php deleted file mode 100644 index e5f785368..000000000 --- a/src/Wallabag/UserBundle/DependencyInjection/Configuration.php +++ /dev/null @@ -1,14 +0,0 @@ -processConfiguration($configuration, $configs); - } - - public function getAlias() - { - return 'wallabag_user'; - } -} diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.da.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.da.yml deleted file mode 100644 index 0967ef424..000000000 --- a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.da.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/src/Wallabag/UserBundle/Resources/views/manage.html.twig b/src/Wallabag/UserBundle/Resources/views/manage.html.twig deleted file mode 100644 index 981e19aaa..000000000 --- a/src/Wallabag/UserBundle/Resources/views/manage.html.twig +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "@WallabagCore/layout.html.twig" %} - -{% block title %}{{ 'user.manage.page_title'|trans }}{% endblock %} - -{% block content %} - -
    -
    -
    -
    -
    -

    {{ 'user.manage.description'|trans|raw }}

    - - - - - - - - - - - - - - {% for user in users %} - - - - - - - - {% endfor %} - -
    {{ 'user.manage.field.username'|trans }}{{ 'user.manage.field.email'|trans }}{{ 'user.manage.field.last_login'|trans }}{{ 'user.manage.field.locked'|trans }}{{ 'user.manage.action'|trans }}
    {{ user.username }}{{ user.email }}{{ user.lastLogin|date('d/m/Y H:i:s') }}{{ user.locked ? 'yes' : 'no' }}edit - delete
    -
    -
    -
    -
    -
    - -{% endblock %} diff --git a/src/Wallabag/UserBundle/WallabagUserBundle.php b/src/Wallabag/UserBundle/WallabagUserBundle.php deleted file mode 100644 index e6e650423..000000000 --- a/src/Wallabag/UserBundle/WallabagUserBundle.php +++ /dev/null @@ -1,9 +0,0 @@ -client = $this->createAuthorizedClient(); - } - - public function logInAs($username) - { - $crawler = $this->client->request('GET', '/login'); - $form = $crawler->filter('button[type=submit]')->form(); - $data = [ - '_username' => $username, - '_password' => 'mypassword', - ]; - - $this->client->submit($form, $data); - } - - /** - * @return KernelBrowser - */ - protected function createAuthorizedClient() - { - $client = static::createClient(); - $container = $client->getContainer(); - - /** @var UserManager $userManager */ - $userManager = $container->get('fos_user.user_manager.test'); - $firewallName = $container->getParameter('fos_user.firewall_name'); - - $this->user = $userManager->findUserBy(['username' => 'admin']); - - $client->loginUser($this->user, $firewallName); - - return $client; - } -} diff --git a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php index d70466818..6bb731e3a 100644 --- a/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/CleanDuplicatesCommandTest.php @@ -7,7 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\User; class CleanDuplicatesCommandTest extends WallabagCoreTestCase { diff --git a/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php b/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php index d90c87f77..e20e02333 100644 --- a/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/GenerateUrlHashesCommandTest.php @@ -7,7 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\User; class GenerateUrlHashesCommandTest extends WallabagCoreTestCase { diff --git a/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php b/tests/Wallabag/CoreBundle/Command/Import/ImportCommandTest.php similarity index 91% rename from tests/Wallabag/ImportBundle/Command/ImportCommandTest.php rename to tests/Wallabag/CoreBundle/Command/Import/ImportCommandTest.php index a58abce9d..44b930e16 100644 --- a/tests/Wallabag/ImportBundle/Command/ImportCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/Import/ImportCommandTest.php @@ -1,6 +1,6 @@ execute([ 'username' => 'admin', - 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json', + 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2-read.json', '--importer' => 'v2', ]); @@ -83,7 +83,7 @@ class ImportCommandTest extends WallabagCoreTestCase $tester = new CommandTester($command); $tester->execute([ 'username' => $this->getLoggedInUserId(), - 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json', + 'filepath' => $application->getKernel()->getContainer()->getParameter('kernel.project_dir') . '/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2-read.json', '--useUserId' => true, '--importer' => 'v2', ]); diff --git a/tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php b/tests/Wallabag/CoreBundle/Command/Import/RedisWorkerCommandTest.php similarity index 97% rename from tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php rename to tests/Wallabag/CoreBundle/Command/Import/RedisWorkerCommandTest.php index 1599683ce..3c2f0c2e7 100644 --- a/tests/Wallabag/ImportBundle/Command/RedisWorkerCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/Import/RedisWorkerCommandTest.php @@ -1,6 +1,6 @@ logInAs('admin'); + + $this->client = $this->getTestClient(); + } + /** * This data provider allow to tests annotation from the : * - API POV (when user use the api to manage annotations) diff --git a/tests/Wallabag/ApiBundle/Controller/ConfigRestControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Api/ConfigRestControllerTest.php similarity index 94% rename from tests/Wallabag/ApiBundle/Controller/ConfigRestControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Api/ConfigRestControllerTest.php index 5547a92fb..039d7e1ff 100644 --- a/tests/Wallabag/ApiBundle/Controller/ConfigRestControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Api/ConfigRestControllerTest.php @@ -1,8 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/chrome-bookmarks', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/chrome-bookmarks', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class ChromeControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/chrome'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/chrome-bookmarks', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/chrome-bookmarks', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -140,7 +140,7 @@ class ChromeControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/chrome'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/DeliciousControllerTest.php similarity index 92% rename from tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/DeliciousControllerTest.php index 1aa4d90af..bba9d06f7 100644 --- a/tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/DeliciousControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/delicious_export.2021.02.06_21.10.json', 'delicious.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/delicious_export.2021.02.06_21.10.json', 'delicious.json'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/delicious'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/delicious_export.2021.02.06_21.10.json', 'delicious.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/delicious_export.2021.02.06_21.10.json', 'delicious.json'); $data = [ 'upload_import_file[file]' => $file, @@ -140,7 +140,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/delicious'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/delicious_export.2021.02.06_21.10.json', 'delicious-read.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/delicious_export.2021.02.06_21.10.json', 'delicious-read.json'); $data = [ 'upload_import_file[file]' => $file, @@ -185,7 +185,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/delicious'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/ElcuratorControllerTest.php similarity index 94% rename from tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/ElcuratorControllerTest.php index 38c872774..0ffb93df9 100644 --- a/tests/Wallabag/ImportBundle/Controller/ElcuratorControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/ElcuratorControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/elcurator.json', 'elcurator.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/elcurator.json', 'elcurator.json'); $data = [ 'upload_import_file[file]' => $file, @@ -100,7 +100,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/elcurator'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/elcurator.json', 'elcurator.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/elcurator.json', 'elcurator.json'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/FirefoxControllerTest.php similarity index 94% rename from tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/FirefoxControllerTest.php index 0e2c5b0ed..0e53aeb66 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/FirefoxControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/firefox-bookmarks.json', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/firefox-bookmarks.json', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/firefox'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/firefox-bookmarks.json', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/firefox-bookmarks.json', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -154,7 +154,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/firefox'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/ImportControllerTest.php similarity index 93% rename from tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/ImportControllerTest.php index b5b220b50..7c6756834 100644 --- a/tests/Wallabag/ImportBundle/Controller/ImportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/ImportControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper.csv'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/instapaper-export.csv', 'instapaper.csv'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/instapaper'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper.csv'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/instapaper-export.csv', 'instapaper.csv'); $data = [ 'upload_import_file[file]' => $file, @@ -153,7 +153,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/instapaper'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/instapaper-export.csv', 'instapaper-read.csv'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/instapaper-export.csv', 'instapaper-read.csv'); $data = [ 'upload_import_file[file]' => $file, @@ -198,7 +198,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/instapaper'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/PinboardControllerTest.php similarity index 94% rename from tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/PinboardControllerTest.php index 833061fe8..53924993d 100644 --- a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/PinboardControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/pinboard_export', 'pinboard.json'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/pinboard_export', 'pinboard.json'); $data = [ 'upload_import_file[file]' => $file, @@ -145,7 +145,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/pinboard_export', 'pinboard-read.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/pinboard_export', 'pinboard-read.json'); $data = [ 'upload_import_file[file]' => $file, @@ -192,7 +192,7 @@ class PinboardControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pinboard'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/PocketControllerTest.php similarity index 97% rename from tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/PocketControllerTest.php index 858689ddd..3ca4e8714 100644 --- a/tests/Wallabag/ImportBundle/Controller/PocketControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/PocketControllerTest.php @@ -1,11 +1,11 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/ril_export.html', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/ril_export.html', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class PocketHtmlControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pocket_html'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/ril_export.html', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/ril_export.html', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -150,7 +150,7 @@ class PocketHtmlControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/pocket_html'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.html', 'test.html'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.html', 'test.html'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/ReadabilityControllerTest.php similarity index 93% rename from tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/ReadabilityControllerTest.php index 7fa3b7f7f..fcf3bc901 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/ReadabilityControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/readability.json', 'readability.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/readability.json', 'readability.json'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/readability'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/readability.json', 'readability.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/readability.json', 'readability.json'); $data = [ 'upload_import_file[file]' => $file, @@ -143,7 +143,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/readability'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/readability-read.json', 'readability-read.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/readability-read.json', 'readability-read.json'); $data = [ 'upload_import_file[file]' => $file, @@ -190,7 +190,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/readability'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/ShaarliControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/ShaarliControllerTest.php similarity index 94% rename from tests/Wallabag/ImportBundle/Controller/ShaarliControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/ShaarliControllerTest.php index 8bc9ffb9d..c5c140d9e 100644 --- a/tests/Wallabag/ImportBundle/Controller/ShaarliControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/ShaarliControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/shaarli-bookmarks.html', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/shaarli-bookmarks.html', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -99,7 +99,7 @@ class ShaarliControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/shaarli'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/shaarli-bookmarks.html', 'Bookmarks'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/shaarli-bookmarks.html', 'Bookmarks'); $data = [ 'upload_import_file[file]' => $file, @@ -150,7 +150,7 @@ class ShaarliControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/shaarli'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.html', 'test.html'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.html', 'test.html'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/WallabagV1ControllerTest.php similarity index 93% rename from tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/WallabagV1ControllerTest.php index 328cbc71c..5ebb29586 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/WallabagV1ControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/wallabag-v1.json', 'wallabag-v1.json'); $data = [ 'upload_import_file[file]' => $file, @@ -100,7 +100,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/wallabag-v1'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/wallabag-v1.json', 'wallabag-v1.json'); $data = [ 'upload_import_file[file]' => $file, @@ -144,7 +144,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/wallabag-v1'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/wallabag-v1-read.json', 'wallabag-v1-read.json'); $data = [ 'upload_import_file[file]' => $file, @@ -191,7 +191,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/wallabag-v1'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/CoreBundle/Controller/Import/WallabagV2ControllerTest.php similarity index 94% rename from tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/Import/WallabagV2ControllerTest.php index c12b0b3e9..d42f11424 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/Import/WallabagV2ControllerTest.php @@ -1,6 +1,6 @@ filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/wallabag-v2.json', 'wallabag-v2.json'); $data = [ 'upload_import_file[file]' => $file, @@ -100,7 +100,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/wallabag-v2'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/wallabag-v2.json', 'wallabag-v2.json'); $data = [ 'upload_import_file[file]' => $file, @@ -166,7 +166,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase $crawler = $client->request('GET', '/import/wallabag-v2'); $form = $crawler->filter('form[name=upload_import_file] > button[type=submit]')->form(); - $file = new UploadedFile(__DIR__ . '/../fixtures/test.txt', 'test.txt'); + $file = new UploadedFile(__DIR__ . '/../../fixtures/Import/test.txt', 'test.txt'); $data = [ 'upload_import_file[file]' => $file, diff --git a/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php b/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php index cb33df278..636214288 100644 --- a/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php @@ -4,7 +4,7 @@ namespace Tests\Wallabag\CoreBundle\Controller; use Doctrine\ORM\EntityManagerInterface; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; -use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\User; class SecurityControllerTest extends WallabagCoreTestCase { diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index 9c5f61fd0..e994b8f13 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php @@ -6,7 +6,7 @@ use Doctrine\ORM\EntityManagerInterface; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; -use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\User; /** * @group Tag diff --git a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php b/tests/Wallabag/CoreBundle/Controller/UserControllerTest.php similarity index 97% rename from tests/Wallabag/UserBundle/Controller/ManageControllerTest.php rename to tests/Wallabag/CoreBundle/Controller/UserControllerTest.php index 86b49b698..e76c61e6a 100644 --- a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/UserControllerTest.php @@ -1,10 +1,10 @@ setPrimaryTable(['name' => 'entry']); $metaClass->mapManyToMany([ 'fieldName' => 'tags', diff --git a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php index f074bfd22..7a3a1c0cf 100644 --- a/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php +++ b/tests/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilderTest.php @@ -9,9 +9,9 @@ use Monolog\Logger; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder; use Wallabag\CoreBundle\Repository\SiteCredentialRepository; -use Wallabag\UserBundle\Entity\User; class GrabySiteConfigBuilderTest extends WallabagCoreTestCase { diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 430ff6d10..2fed3e498 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php @@ -11,10 +11,10 @@ use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Validator\RecursiveValidator; use Wallabag\CoreBundle\Entity\Entry; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Helper\ContentProxy; use Wallabag\CoreBundle\Helper\RuleBasedIgnoreOriginProcessor; use Wallabag\CoreBundle\Helper\RuleBasedTagger; -use Wallabag\UserBundle\Entity\User; class ContentProxyTest extends TestCase { diff --git a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php index 9c0322d3f..fece6156e 100644 --- a/tests/Wallabag/CoreBundle/Helper/RedirectTest.php +++ b/tests/Wallabag/CoreBundle/Helper/RedirectTest.php @@ -8,8 +8,8 @@ use Symfony\Component\Routing\Router; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Wallabag\CoreBundle\Entity\Config; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Helper\Redirect; -use Wallabag\UserBundle\Entity\User; class RedirectTest extends TestCase { diff --git a/tests/Wallabag/CoreBundle/Helper/RuleBasedIgnoreOriginProcessorTest.php b/tests/Wallabag/CoreBundle/Helper/RuleBasedIgnoreOriginProcessorTest.php index 4bd62ba4e..da550efd4 100644 --- a/tests/Wallabag/CoreBundle/Helper/RuleBasedIgnoreOriginProcessorTest.php +++ b/tests/Wallabag/CoreBundle/Helper/RuleBasedIgnoreOriginProcessorTest.php @@ -10,9 +10,9 @@ use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule; use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Helper\RuleBasedIgnoreOriginProcessor; use Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository; -use Wallabag\UserBundle\Entity\User; class RuleBasedIgnoreOriginProcessorTest extends TestCase { diff --git a/tests/Wallabag/CoreBundle/Helper/RuleBasedTaggerTest.php b/tests/Wallabag/CoreBundle/Helper/RuleBasedTaggerTest.php index da11737ca..6bd837057 100644 --- a/tests/Wallabag/CoreBundle/Helper/RuleBasedTaggerTest.php +++ b/tests/Wallabag/CoreBundle/Helper/RuleBasedTaggerTest.php @@ -12,10 +12,10 @@ use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\TaggingRule; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Helper\RuleBasedTagger; use Wallabag\CoreBundle\Repository\EntryRepository; use Wallabag\CoreBundle\Repository\TagRepository; -use Wallabag\UserBundle\Entity\User; class RuleBasedTaggerTest extends TestCase { diff --git a/tests/Wallabag/CoreBundle/Helper/TagsAssignerTest.php b/tests/Wallabag/CoreBundle/Helper/TagsAssignerTest.php index 1285c99c6..7fa507659 100644 --- a/tests/Wallabag/CoreBundle/Helper/TagsAssignerTest.php +++ b/tests/Wallabag/CoreBundle/Helper/TagsAssignerTest.php @@ -5,9 +5,9 @@ namespace Tests\Wallabag\CoreBundle\Helper; use PHPUnit\Framework\TestCase; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\Helper\TagsAssigner; use Wallabag\CoreBundle\Repository\TagRepository; -use Wallabag\UserBundle\Entity\User; class TagsAssignerTest extends TestCase { diff --git a/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php b/tests/Wallabag/CoreBundle/Import/ChromeImportTest.php similarity index 91% rename from tests/Wallabag/ImportBundle/Import/ChromeImportTest.php rename to tests/Wallabag/CoreBundle/Import/ChromeImportTest.php index 2829466c0..fc3981cd5 100644 --- a/tests/Wallabag/ImportBundle/Import/ChromeImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/ChromeImportTest.php @@ -1,6 +1,6 @@ getChromeImport(false, 1); - $chromeImport->setFilepath(__DIR__ . '/../fixtures/chrome-bookmarks'); + $chromeImport->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/chrome-bookmarks'); $res = $chromeImport->import(); diff --git a/tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php b/tests/Wallabag/CoreBundle/Import/FirefoxImportTest.php similarity index 91% rename from tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php rename to tests/Wallabag/CoreBundle/Import/FirefoxImportTest.php index 362c2ee05..6be097b93 100644 --- a/tests/Wallabag/ImportBundle/Import/FirefoxImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/FirefoxImportTest.php @@ -1,6 +1,6 @@ getFirefoxImport(false, 2); - $firefoxImport->setFilepath(__DIR__ . '/../fixtures/firefox-bookmarks.json'); + $firefoxImport->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/firefox-bookmarks.json'); $res = $firefoxImport->import(); diff --git a/tests/Wallabag/ImportBundle/Import/ImportChainTest.php b/tests/Wallabag/CoreBundle/Import/ImportChainTest.php similarity index 77% rename from tests/Wallabag/ImportBundle/Import/ImportChainTest.php rename to tests/Wallabag/CoreBundle/Import/ImportChainTest.php index c3984fa63..424b84b64 100644 --- a/tests/Wallabag/ImportBundle/Import/ImportChainTest.php +++ b/tests/Wallabag/CoreBundle/Import/ImportChainTest.php @@ -1,10 +1,10 @@ register('foo') - ->addTag('wallabag_import.import', ['alias' => 'pocket']) + ->addTag('wallabag_core.import', ['alias' => 'pocket']) ; $this->process($container); diff --git a/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php b/tests/Wallabag/CoreBundle/Import/InstapaperImportTest.php similarity index 91% rename from tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php rename to tests/Wallabag/CoreBundle/Import/InstapaperImportTest.php index 84900d3fb..db05acb52 100644 --- a/tests/Wallabag/ImportBundle/Import/InstapaperImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/InstapaperImportTest.php @@ -1,6 +1,6 @@ getInstapaperImport(false, 4); - $instapaperImport->setFilepath(__DIR__ . '/../fixtures/instapaper-export.csv'); + $instapaperImport->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/instapaper-export.csv'); $res = $instapaperImport->import(); diff --git a/tests/Wallabag/ImportBundle/Import/PocketHtmlImportTest.php b/tests/Wallabag/CoreBundle/Import/PocketHtmlImportTest.php similarity index 91% rename from tests/Wallabag/ImportBundle/Import/PocketHtmlImportTest.php rename to tests/Wallabag/CoreBundle/Import/PocketHtmlImportTest.php index 6ff5e13a0..296d64e17 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketHtmlImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/PocketHtmlImportTest.php @@ -1,6 +1,6 @@ getPocketHtmlImport(false, 2); - $pocketHtmlImport->setFilepath(__DIR__ . '/../fixtures/ril_export.html'); + $pocketHtmlImport->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/ril_export.html'); $res = $pocketHtmlImport->import(); diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/CoreBundle/Import/PocketImportTest.php similarity index 99% rename from tests/Wallabag/ImportBundle/Import/PocketImportTest.php rename to tests/Wallabag/CoreBundle/Import/PocketImportTest.php index f6a09f18c..270e38065 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/PocketImportTest.php @@ -1,6 +1,6 @@ getReadabilityImport(false, 3); - $readabilityImport->setFilepath(__DIR__ . '/../fixtures/readability.json'); + $readabilityImport->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/readability.json'); $res = $readabilityImport->import(); diff --git a/tests/Wallabag/ImportBundle/Import/ShaarliImportTest.php b/tests/Wallabag/CoreBundle/Import/ShaarliImportTest.php similarity index 91% rename from tests/Wallabag/ImportBundle/Import/ShaarliImportTest.php rename to tests/Wallabag/CoreBundle/Import/ShaarliImportTest.php index 04f8223dd..3ff7fe0a6 100644 --- a/tests/Wallabag/ImportBundle/Import/ShaarliImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/ShaarliImportTest.php @@ -1,6 +1,6 @@ getShaarliImport(false, 2); - $shaarliImport->setFilepath(__DIR__ . '/../fixtures/shaarli-bookmarks.html'); + $shaarliImport->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/shaarli-bookmarks.html'); $res = $shaarliImport->import(); diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php b/tests/Wallabag/CoreBundle/Import/WallabagV1ImportTest.php similarity index 92% rename from tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php rename to tests/Wallabag/CoreBundle/Import/WallabagV1ImportTest.php index 5da4aa658..cdf96ed02 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV1ImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/WallabagV1ImportTest.php @@ -1,6 +1,6 @@ getWallabagV1Import(false, 1); - $wallabagV1Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v1.json'); + $wallabagV1Import->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/wallabag-v1.json'); $res = $wallabagV1Import->import(); diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php b/tests/Wallabag/CoreBundle/Import/WallabagV2ImportTest.php similarity index 90% rename from tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php rename to tests/Wallabag/CoreBundle/Import/WallabagV2ImportTest.php index 59173f58a..b19ee11a6 100644 --- a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php +++ b/tests/Wallabag/CoreBundle/Import/WallabagV2ImportTest.php @@ -1,6 +1,6 @@ getWallabagV2Import(false, 2); - $wallabagV2Import->setFilepath(__DIR__ . '/../fixtures/wallabag-v2.json'); + $wallabagV2Import->setFilepath(__DIR__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../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__ . '/../fixtures/Import/wallabag-v2.json'); $entryRepo = $this->getMockBuilder(EntryRepository::class) ->disableOriginalConstructor() diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/CoreBundle/Mailer/AuthCodeMailerTest.php similarity index 92% rename from tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php rename to tests/Wallabag/CoreBundle/Mailer/AuthCodeMailerTest.php index 983d39a34..70db27904 100644 --- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php +++ b/tests/Wallabag/CoreBundle/Mailer/AuthCodeMailerTest.php @@ -1,14 +1,14 @@ twig = new Environment(new ArrayLoader(['@WallabagUser/TwoFactor/email_auth_code.html.twig' => $twigTemplate])); + $this->twig = new Environment(new ArrayLoader(['@WallabagCore/TwoFactor/email_auth_code.html.twig' => $twigTemplate])); } public function testSendEmail() diff --git a/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php b/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php index 9c7a41731..71ea2d288 100644 --- a/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php +++ b/tests/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverterTest.php @@ -9,9 +9,9 @@ use PHPUnit\Framework\TestCase; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Wallabag\CoreBundle\Entity\User; use Wallabag\CoreBundle\ParamConverter\UsernameFeedTokenConverter; -use Wallabag\UserBundle\Entity\User; -use Wallabag\UserBundle\Repository\UserRepository; +use Wallabag\CoreBundle\Repository\UserRepository; class UsernameFeedTokenConverterTest extends TestCase { diff --git a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php index a5654a83f..dbe19ffe9 100644 --- a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php +++ b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php @@ -9,7 +9,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Wallabag\UserBundle\Entity\User; +use Wallabag\CoreBundle\Entity\User; abstract class WallabagCoreTestCase extends WebTestCase { @@ -48,11 +48,12 @@ abstract class WallabagCoreTestCase extends WebTestCase 'command' => 'doctrine:schema:drop', '--no-interaction' => true, '--force' => true, + '--full-database' => true, '--env' => 'test', ]), new NullOutput()); $application->run(new ArrayInput([ - 'command' => 'doctrine:schema:create', + 'command' => 'doctrine:migrations:migrate', '--no-interaction' => true, '--env' => 'test', ]), new NullOutput()); diff --git a/tests/Wallabag/ImportBundle/fixtures/chrome-bookmarks b/tests/Wallabag/CoreBundle/fixtures/Import/chrome-bookmarks similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/chrome-bookmarks rename to tests/Wallabag/CoreBundle/fixtures/Import/chrome-bookmarks diff --git a/tests/Wallabag/ImportBundle/fixtures/delicious_export.2021.02.06_21.10.json b/tests/Wallabag/CoreBundle/fixtures/Import/delicious_export.2021.02.06_21.10.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/delicious_export.2021.02.06_21.10.json rename to tests/Wallabag/CoreBundle/fixtures/Import/delicious_export.2021.02.06_21.10.json diff --git a/tests/Wallabag/ImportBundle/fixtures/elcurator.json b/tests/Wallabag/CoreBundle/fixtures/Import/elcurator.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/elcurator.json rename to tests/Wallabag/CoreBundle/fixtures/Import/elcurator.json diff --git a/tests/Wallabag/ImportBundle/fixtures/firefox-bookmarks.json b/tests/Wallabag/CoreBundle/fixtures/Import/firefox-bookmarks.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/firefox-bookmarks.json rename to tests/Wallabag/CoreBundle/fixtures/Import/firefox-bookmarks.json diff --git a/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv b/tests/Wallabag/CoreBundle/fixtures/Import/instapaper-export.csv similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv rename to tests/Wallabag/CoreBundle/fixtures/Import/instapaper-export.csv diff --git a/tests/Wallabag/ImportBundle/fixtures/pinboard_export b/tests/Wallabag/CoreBundle/fixtures/Import/pinboard_export similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/pinboard_export rename to tests/Wallabag/CoreBundle/fixtures/Import/pinboard_export diff --git a/tests/Wallabag/ImportBundle/fixtures/readability-read.json b/tests/Wallabag/CoreBundle/fixtures/Import/readability-read.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/readability-read.json rename to tests/Wallabag/CoreBundle/fixtures/Import/readability-read.json diff --git a/tests/Wallabag/ImportBundle/fixtures/readability.json b/tests/Wallabag/CoreBundle/fixtures/Import/readability.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/readability.json rename to tests/Wallabag/CoreBundle/fixtures/Import/readability.json diff --git a/tests/Wallabag/ImportBundle/fixtures/ril_export.html b/tests/Wallabag/CoreBundle/fixtures/Import/ril_export.html similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/ril_export.html rename to tests/Wallabag/CoreBundle/fixtures/Import/ril_export.html diff --git a/tests/Wallabag/ImportBundle/fixtures/shaarli-bookmarks.html b/tests/Wallabag/CoreBundle/fixtures/Import/shaarli-bookmarks.html similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/shaarli-bookmarks.html rename to tests/Wallabag/CoreBundle/fixtures/Import/shaarli-bookmarks.html diff --git a/tests/Wallabag/ImportBundle/fixtures/test.html b/tests/Wallabag/CoreBundle/fixtures/Import/test.html similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/test.html rename to tests/Wallabag/CoreBundle/fixtures/Import/test.html diff --git a/tests/Wallabag/ImportBundle/fixtures/test.txt b/tests/Wallabag/CoreBundle/fixtures/Import/test.txt similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/test.txt rename to tests/Wallabag/CoreBundle/fixtures/Import/test.txt diff --git a/tests/Wallabag/ImportBundle/fixtures/unnamed.png b/tests/Wallabag/CoreBundle/fixtures/Import/unnamed.png similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/unnamed.png rename to tests/Wallabag/CoreBundle/fixtures/Import/unnamed.png diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v1-read.json b/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v1-read.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/wallabag-v1-read.json rename to tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v1-read.json diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v1.json b/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v1.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/wallabag-v1.json rename to tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v1.json diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json b/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2-empty.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json rename to tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2-empty.json diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json b/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2-read.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/wallabag-v2-read.json rename to tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2-read.json diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json b/tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2.json similarity index 100% rename from tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json rename to tests/Wallabag/CoreBundle/fixtures/Import/wallabag-v2.json