forked from wallabag/wallabag
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 76ee8a9ea5 | |||
| 80bb0b7344 | |||
| 5068544e10 | |||
| c649d43381 | |||
| d35ba2c3d6 | |||
| 4e4e8e9899 | |||
| 8642f14220 | |||
| 19d9efab32 | |||
| e7732deb1f | |||
| eecd7e406d | |||
| 4e1be104ab | |||
| 519ba0b5e7 | |||
| e408d7e895 | |||
| 41c9eecfa7 | |||
| b762ab3cce | |||
| fc41abb990 | |||
| 782390a80e | |||
| 0cecfa2536 | |||
| 6dfac457d8 | |||
| 9a5c5c330e | |||
| 7dbedfc8a3 | |||
| e49c62fac8 | |||
| 8f5e220327 | |||
| 2e16a90339 | |||
| 848c2e1b97 | |||
| 00acc0d006 |
35
.travis.yml
35
.travis.yml
@ -20,8 +20,8 @@ php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
- nightly
|
||||
- hhvm
|
||||
|
||||
env:
|
||||
- DB=mysql
|
||||
@ -31,13 +31,30 @@ env:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
# driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
|
||||
- php: hhvm-3.12
|
||||
sudo: required
|
||||
dist: trusty
|
||||
group: edge
|
||||
env: DB=mysql
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- mysql-server-5.6
|
||||
- mysql-client-core-5.6
|
||||
- mysql-client-5.6
|
||||
services:
|
||||
- mysql
|
||||
- php: hhvm-3.12
|
||||
sudo: required
|
||||
dist: trusty
|
||||
group: edge
|
||||
env: DB=sqlite
|
||||
- php: 7.0
|
||||
env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite
|
||||
exclude:
|
||||
- php: hhvm
|
||||
env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
- php: hhvm-3.12
|
||||
- php: nightly
|
||||
|
||||
# exclude v1 branches
|
||||
branches:
|
||||
@ -45,8 +62,10 @@ branches:
|
||||
- legacy
|
||||
|
||||
before_script:
|
||||
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
|
||||
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
|
||||
- PHP=$TRAVIS_PHP_VERSION
|
||||
- if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
|
||||
# xdebug isn't enable for PHP 7.1
|
||||
- if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
||||
- composer self-update --no-progress
|
||||
- if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
|
||||
|
||||
@ -54,7 +73,7 @@ before_install:
|
||||
- if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
|
||||
|
||||
script:
|
||||
- travis_wait composer install --no-interaction --no-progress --prefer-dist -o
|
||||
- travis_wait composer update --no-interaction --no-progress
|
||||
- ant prepare-$DB
|
||||
- phpunit -v
|
||||
- if [ "$CS_FIXER" = "run" ]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi;
|
||||
|
||||
26
.zappr.yaml
Normal file
26
.zappr.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
# see https://zappr.opensource.zalan.do/
|
||||
autobranch: false
|
||||
commit: false
|
||||
approvals:
|
||||
minimum: 1
|
||||
ignore: pr_opener
|
||||
pattern: "^(:\\+1:|👍)$"
|
||||
veto:
|
||||
pattern: "^(:\\-1:|👎)$"
|
||||
from:
|
||||
orgs:
|
||||
- wallabag
|
||||
collaborators: true
|
||||
specification:
|
||||
title:
|
||||
minimum-length:
|
||||
enabled: true
|
||||
length: 8
|
||||
body:
|
||||
minimum-length:
|
||||
enabled: true
|
||||
length: 8
|
||||
contains-url: false
|
||||
contains-issue-number: false
|
||||
template:
|
||||
differs-from-body: true
|
||||
17
CHANGELOG.md
17
CHANGELOG.md
@ -2,6 +2,23 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [2.0.7] - 2016-08-22
|
||||
|
||||
### Added
|
||||
|
||||
- [#2222](https://github.com/wallabag/wallabag/pull/2222) Added creation date and reading time on article view (Nicolas Lœuillet)
|
||||
- [#2134](https://github.com/wallabag/wallabag/pull/2134) Run tests on an uptodate HHVM (Jeremy Benoist)
|
||||
|
||||
### Changed
|
||||
|
||||
- [#2221](https://github.com/wallabag/wallabag/pull/2221) Replaced favorite word/icon with star one (Nicolas Lœuillet)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#2224](https://github.com/wallabag/wallabag/pull/2224) Avoid breaking import when fetching fail (Jeremy Benoist)
|
||||
- [#2216](https://github.com/wallabag/wallabag/pull/2216), [#2220](https://github.com/wallabag/wallabag/pull/2220) Enable CORS headers for OAUTH part (Rurik19)
|
||||
- [#2095](https://github.com/wallabag/wallabag/pull/2095) Fix form user display when 2FA is disabled (Nicolas Lœuillet)
|
||||
|
||||
## [2.0.6] - 2016-08-10
|
||||
|
||||
### Changed
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[](https://travis-ci.org/wallabag/wallabag)
|
||||
[](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=v2)
|
||||
[](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=master)
|
||||
[](https://gitter.im/wallabag/wallabag)
|
||||
|
||||
# What is wallabag?
|
||||
@ -16,7 +16,7 @@ Then you can install wallabag by executing the following commands:
|
||||
```
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.6
|
||||
git checkout 2.0.7
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
php bin/console server:run --env=prod
|
||||
|
||||
@ -30,7 +30,7 @@ framework:
|
||||
assets: ~
|
||||
|
||||
wallabag_core:
|
||||
version: 2.0.6
|
||||
version: 2.0.7
|
||||
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
|
||||
languages:
|
||||
en: 'English'
|
||||
@ -151,6 +151,11 @@ nelmio_cors:
|
||||
#origin_regex: false
|
||||
paths:
|
||||
'^/api/':
|
||||
allow_origin: ['*']
|
||||
allow_headers: ['X-Custom-Auth']
|
||||
allow_methods: ['POST', 'PUT', 'PATCH','GET', 'DELETE']
|
||||
max_age: 3600
|
||||
'^/oauth/':
|
||||
allow_origin: ['*']
|
||||
allow_headers: ['X-Custom-Auth']
|
||||
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
|
||||
|
||||
7436
composer.lock
generated
Normal file
7436
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -54,7 +54,7 @@ Um wallabag selbst zu installieren, musst du die folgenden Kommandos ausführen:
|
||||
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.6
|
||||
git checkout 2.0.7
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ To install wallabag itself, you must run the following commands:
|
||||
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.6
|
||||
git checkout 2.0.7
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Pour installer wallabag, vous devez exécuter ces deux commandes :
|
||||
|
||||
git clone https://github.com/wallabag/wallabag.git
|
||||
cd wallabag
|
||||
git checkout 2.0.6
|
||||
git checkout 2.0.7
|
||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||
php bin/console wallabag:install --env=prod
|
||||
|
||||
|
||||
@ -357,7 +357,7 @@ class EntryController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes favorite status for an entry.
|
||||
* Changes starred status for an entry.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Entry $entry
|
||||
|
||||
@ -16,7 +16,7 @@ class StringToListTransformer implements DataTransformerInterface
|
||||
private $separator;
|
||||
|
||||
/**
|
||||
* @param string $separator The separator used in the list.
|
||||
* @param string $separator The separator used in the list
|
||||
*/
|
||||
public function __construct($separator = ',')
|
||||
{
|
||||
|
||||
@ -21,7 +21,9 @@ class ConfigType extends AbstractType
|
||||
{
|
||||
$this->themes = array_combine(
|
||||
$themes,
|
||||
array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s))); }, $themes)
|
||||
array_map(function ($s) {
|
||||
return ucwords(strtolower(str_replace('-', ' ', $s)));
|
||||
}, $themes)
|
||||
);
|
||||
|
||||
$this->languages = $languages;
|
||||
|
||||
@ -25,7 +25,7 @@ class RuleBasedTagger
|
||||
/**
|
||||
* Add tags from rules defined by the user.
|
||||
*
|
||||
* @param Entry $entry Entry to tag.
|
||||
* @param Entry $entry Entry to tag
|
||||
*/
|
||||
public function tag(Entry $entry)
|
||||
{
|
||||
@ -49,7 +49,7 @@ class RuleBasedTagger
|
||||
*
|
||||
* @param User $user
|
||||
*
|
||||
* @return array<Entry> A list of modified entries.
|
||||
* @return array<Entry> A list of modified entries
|
||||
*/
|
||||
public function tagAllForUser(User $user)
|
||||
{
|
||||
@ -75,7 +75,7 @@ class RuleBasedTagger
|
||||
/**
|
||||
* Fetch a tag.
|
||||
*
|
||||
* @param string $label The tag's label.
|
||||
* @param string $label The tag's label
|
||||
*
|
||||
* @return Tag
|
||||
*/
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'estimeret læsetid'
|
||||
reading_time_minutes: 'estimeret læsetid: %readingTime% min'
|
||||
reading_time_less_one_minute: 'estimeret læsetid: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Marker som læst'
|
||||
toogle_as_star: 'Skift favoritstatus'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Tilbage'
|
||||
set_as_read: 'Marker som læst'
|
||||
# set_as_unread: 'Mark as unread'
|
||||
set_as_favorite: 'Marker som favorit'
|
||||
set_as_starred: 'Marker som favorit'
|
||||
view_original_article: 'Originalartikel'
|
||||
# re_fetch_content: 'Re-fetch content'
|
||||
delete: 'Slet'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Rediger titel'
|
||||
original_article: 'original'
|
||||
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
|
||||
created_at: 'Oprettelsesdato'
|
||||
new:
|
||||
page_title: 'Gem ny artikel'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'geschätzte Lesezeit'
|
||||
reading_time_minutes: 'geschätzte Lesezeit: %readingTime% min'
|
||||
reading_time_less_one_minute: 'geschätzte Lesezeit: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Gelesen-Status ändern'
|
||||
toogle_as_star: 'Favoriten-Status ändern'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Zurück'
|
||||
set_as_read: 'Als gelesen markieren'
|
||||
set_as_unread: 'Als ungelesen markieren'
|
||||
set_as_favorite: 'Favorisieren'
|
||||
set_as_starred: 'Favorisieren'
|
||||
view_original_article: 'Original-Artikel'
|
||||
re_fetch_content: 'Inhalt neu laden'
|
||||
delete: 'Löschen'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Titel ändern'
|
||||
original_article: 'original'
|
||||
annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %nbAnnotations% Anmerkungen'
|
||||
created_at: 'Erstellungsdatum'
|
||||
new:
|
||||
page_title: 'Neuen Artikel speichern'
|
||||
placeholder: 'https://website.de'
|
||||
|
||||
@ -144,9 +144,11 @@ entry:
|
||||
reading_time: 'estimated reading time'
|
||||
reading_time_minutes: 'estimated reading time: %readingTime% min'
|
||||
reading_time_less_one_minute: 'estimated reading time: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Toggle mark as read'
|
||||
toogle_as_star: 'Toggle favorite'
|
||||
toogle_as_star: 'Toggle starred'
|
||||
delete: 'Delete'
|
||||
export_title: 'Export'
|
||||
filters:
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Back'
|
||||
set_as_read: 'Mark as read'
|
||||
set_as_unread: 'Mark as unread'
|
||||
set_as_favorite: 'Favorite'
|
||||
set_as_starred: 'Toggle starred'
|
||||
view_original_article: 'Original article'
|
||||
re_fetch_content: 'Re-fetch content'
|
||||
delete: 'Delete'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Edit title'
|
||||
original_article: 'original'
|
||||
annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
|
||||
created_at: 'Creation date'
|
||||
new:
|
||||
page_title: 'Save new entry'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'tiempo estimado de lectura'
|
||||
reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min'
|
||||
reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Marcar como leído/ no leído'
|
||||
toogle_as_star: 'Marcar como favorito/ no favorito'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Regrese a la página principal'
|
||||
set_as_read: 'Marcar como leído'
|
||||
set_as_unread: 'Marcar como no leído'
|
||||
set_as_favorite: 'Marcar como favorito'
|
||||
set_as_starred: 'Marcar como favorito'
|
||||
view_original_article: 'Artículo original'
|
||||
re_fetch_content: 'Redescargar el contenido'
|
||||
delete: 'Suprimir'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Modificar el título'
|
||||
original_article: 'original'
|
||||
annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %nbAnnotations% anotaciones'
|
||||
created_at: 'Fecha de creación'
|
||||
new:
|
||||
page_title: 'Guardar un nuevo artículo'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'زمان تخمینی برای خواندن'
|
||||
reading_time_minutes: 'زمان تخمینی برای خواندن: %readingTime% min'
|
||||
reading_time_less_one_minute: 'زمان تخمینی برای خواندن: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'خواندهشده/خواندهنشده'
|
||||
toogle_as_star: 'برگزیده/نابرگزیده'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'بازگشت'
|
||||
set_as_read: 'خواندهشده'
|
||||
set_as_unread: 'به عنوان خواندهنشده علامت بزن'
|
||||
set_as_favorite: 'برگزیده'
|
||||
set_as_starred: 'برگزیده'
|
||||
view_original_article: 'مقالهٔ اصلی'
|
||||
re_fetch_content: 'مقالهها را دوباره دریافت کن'
|
||||
delete: 'پاک کردن'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'ویرایش عنوان'
|
||||
original_article: 'اصلی'
|
||||
annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations'
|
||||
created_at: 'زمان ساخت'
|
||||
new:
|
||||
page_title: 'ذخیرهٔ مقالهٔ تازه'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'durée de lecture'
|
||||
reading_time_minutes: 'durée de lecture: %readingTime% min'
|
||||
reading_time_less_one_minute: 'durée de lecture: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Marquer comme lu/non lu'
|
||||
toogle_as_star: 'Marquer comme favori'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Retour'
|
||||
set_as_read: 'Marquer comme lu'
|
||||
set_as_unread: 'Marquer comme non lu'
|
||||
set_as_favorite: 'Mettre en favori'
|
||||
set_as_starred: 'Mettre en favori'
|
||||
view_original_article: 'Article original'
|
||||
re_fetch_content: 'Recharger le contenu'
|
||||
delete: 'Supprimer'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Modifier le titre'
|
||||
original_article: 'original'
|
||||
annotations_on_the_entry: '{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbAnnotations% annotations'
|
||||
created_at: 'Date de création'
|
||||
new:
|
||||
page_title: 'Sauvegarder un nouvel article'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'tempo di lettura stimato'
|
||||
reading_time_minutes: 'tempo di lettura stimato: %readingTime% min'
|
||||
reading_time_less_one_minute: 'tempo di lettura stimato: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'originale'
|
||||
toogle_as_read: 'Segna come da leggere'
|
||||
toogle_as_star: 'Segna come non preferito'
|
||||
@ -175,7 +177,7 @@ entry:
|
||||
back_to_homepage: 'Indietro'
|
||||
set_as_read: 'Segna come già letto'
|
||||
set_as_unread: 'Segna come da leggere'
|
||||
set_as_favorite: 'Segna come preferito'
|
||||
set_as_starred: 'Segna come preferito'
|
||||
view_original_article: 'Contenuto originale'
|
||||
re_fetch_content: 'Ri-ottieni pagina'
|
||||
delete: 'Elimina'
|
||||
@ -190,6 +192,7 @@ entry:
|
||||
edit_title: 'Modifica titolo'
|
||||
original_article: 'originale'
|
||||
annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %nbAnnotations% annotazioni'
|
||||
created_at: 'Data di creazione'
|
||||
new:
|
||||
page_title: 'Salva un nuovo contenuto'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'durada de lectura'
|
||||
reading_time_minutes: 'durada de lectura : %readingTime% min'
|
||||
reading_time_less_one_minute: 'durada de lectura : <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Marcar coma legit/pas legit'
|
||||
toogle_as_star: 'Marcar coma favorit'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Tornar'
|
||||
set_as_read: 'Marcar coma legit'
|
||||
set_as_unread: 'Marcar coma pas legit'
|
||||
set_as_favorite: 'Metre en favori'
|
||||
set_as_starred: 'Metre en favori'
|
||||
view_original_article: 'Article original'
|
||||
re_fetch_content: 'Tornar cargar lo contengut'
|
||||
delete: 'Suprimir'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Modificar lo títol'
|
||||
original_article: 'original'
|
||||
annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %nbAnnotations% anotacions"
|
||||
created_at: 'Data de creacion'
|
||||
new:
|
||||
page_title: 'Enregistrar un novèl article'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'szacunkowy czas czytania'
|
||||
reading_time_minutes: 'szacunkowy czas czytania: %readingTime% min'
|
||||
reading_time_less_one_minute: 'szacunkowy czas czytania: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'oryginał'
|
||||
toogle_as_read: 'Oznacz jako przeczytane'
|
||||
toogle_as_star: 'Oznacz jako ulubione'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Cofnij'
|
||||
set_as_read: 'Oznacz jako przeczytane'
|
||||
set_as_unread: 'Oznacz jako nieprzeczytane'
|
||||
set_as_favorite: 'Ulubione'
|
||||
set_as_starred: 'Ulubione'
|
||||
view_original_article: 'Oryginalny artykuł'
|
||||
re_fetch_content: 'Pobierz ponownie treść'
|
||||
delete: 'Usuń'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Edytuj tytuł'
|
||||
original_article: 'oryginalny'
|
||||
annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %nbAnnotations% adnotacji'
|
||||
created_at: 'Czas stworzenia'
|
||||
new:
|
||||
page_title: 'Zapisz nowy wpis'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'timp estimat de citire'
|
||||
reading_time_minutes: 'timp estimat de citire: %readingTime% min'
|
||||
reading_time_less_one_minute: 'timp estimat de citire: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'original'
|
||||
toogle_as_read: 'Comută marcat ca citit'
|
||||
toogle_as_star: 'Comută marcat ca favorit'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Înapoi'
|
||||
set_as_read: 'Marchează ca citit'
|
||||
# set_as_unread: 'Mark as unread'
|
||||
set_as_favorite: 'Favorit'
|
||||
set_as_starred: 'Favorit'
|
||||
view_original_article: 'Articol original'
|
||||
# re_fetch_content: 'Re-fetch content'
|
||||
delete: 'Șterge'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Editează titlul'
|
||||
original_article: 'original'
|
||||
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
|
||||
created_at: 'Data creării'
|
||||
new:
|
||||
page_title: 'Salvează un nou articol'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -144,6 +144,8 @@ entry:
|
||||
reading_time: 'tahmini okuma süresi'
|
||||
reading_time_minutes: 'tahmini okuma süresi: %readingTime% min'
|
||||
reading_time_less_one_minute: 'tahmini okuma süresi: <small class="inferieur"><</small> 1 min'
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
reading_time_less_one_minute_short: '<small class="inferieur"><</small> 1 min'
|
||||
original_article: 'orijinal'
|
||||
toogle_as_read: 'Okundu/okunmadı olarak işaretle'
|
||||
toogle_as_star: 'Favorilere ekle/çıkar'
|
||||
@ -176,7 +178,7 @@ entry:
|
||||
back_to_homepage: 'Back'
|
||||
set_as_read: 'Okundu olarak işaretle'
|
||||
set_as_unread: 'Okunmadı olarak işaretle'
|
||||
set_as_favorite: 'Favorilere ekle/çıkar'
|
||||
set_as_starred: 'Favorilere ekle/çıkar'
|
||||
view_original_article: 'Orijinal makale'
|
||||
re_fetch_content: 'İçeriği yenile'
|
||||
delete: 'Sil'
|
||||
@ -191,6 +193,7 @@ entry:
|
||||
edit_title: 'Başlığı düzenle'
|
||||
original_article: 'orijinal'
|
||||
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
|
||||
created_at: 'Oluşturulma tarihi'
|
||||
new:
|
||||
page_title: 'Yeni makaleyi kaydet'
|
||||
placeholder: 'http://website.com'
|
||||
|
||||
@ -134,7 +134,8 @@
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
|
||||
{{ form_rest(form.user) }}
|
||||
{{ form_widget(form.user._token) }}
|
||||
{{ form_widget(form.user.save) }}
|
||||
</form>
|
||||
|
||||
<h2>{{ 'config.tab_menu.password'|trans }}</h2>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.domainName|removeWww }}</span></a></li>
|
||||
<li><a title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" class="tool icon icon-reload" href="{{ path('reload_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span></a></li>
|
||||
<li><a title="{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}</span></a></li>
|
||||
<li><a title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_favorite'|trans }}</span></a></li>
|
||||
<li><a title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span></a></li>
|
||||
<li><a id="nav-btn-add-tag" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li>
|
||||
<li><a title="{{ 'entry.view.left_menu.delete'|trans }}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li>
|
||||
{% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
|
||||
@ -29,6 +29,19 @@
|
||||
<li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.label'|trans }}" class="tool bad-display icon icon-delete"><span>{{ 'entry.view.left_menu.problem.label'|trans }}</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="link mdi-action-today">
|
||||
{{ 'entry.view.created_at'|trans }}: {{ entry.createdAt|date('Y-m-d') }}
|
||||
</div>
|
||||
|
||||
<div class="link mdi-action-query-builder">
|
||||
{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
|
||||
{% if readingTime > 0 %}
|
||||
{{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round})|capitalize }}
|
||||
{% else %}
|
||||
{{ 'entry.list.reading_time_less_one_minute'|trans|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% set nbAnnotations = entry.annotations | length %}
|
||||
<span class="tool link mdi-communication-comment"> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
|
||||
<aside class="tags">
|
||||
@ -72,7 +85,7 @@
|
||||
$("body").css("cursor", "auto");
|
||||
});*/
|
||||
|
||||
// toggle favorite property of current article
|
||||
// toggle starred property of current article
|
||||
/* $('#setFav').click(function(){
|
||||
$("body").css("cursor", "wait");
|
||||
$.ajax( { url: '{{ path('star_entry', { 'id': entry.id }) }}' }).done(
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
{% endif %}
|
||||
|
||||
{{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
||||
{{ form_rest(form.user) }}
|
||||
{{ form_widget(form.user._token) }}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
<ul class="tools links right">
|
||||
<li>
|
||||
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text {% if entry.isArchived == 0 %}mdi-action-done{% else %}mdi-content-redo{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"></a>
|
||||
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text {% if entry.isStarred == 0 %}mdi-action-favorite-outline{% else %}mdi-action-favorite{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"></a>
|
||||
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text {% if entry.isStarred == 0 %}mdi-toggle-star-outline{% else %}mdi-toggle-star{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"></a>
|
||||
<a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete mdi-action-delete " href="{{ path('delete_entry', { 'id': entry.id }) }}"></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
|
||||
<i class="{% if entry.isStarred == 0 %}mdi-action-favorite-outline{% else %}mdi-action-favorite{% endif %} small"></i>
|
||||
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
|
||||
<i class="{% if entry.isStarred == 0 %}mdi-toggle-star-outline{% else %}mdi-toggle-star{% endif %} small"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@ -70,9 +70,9 @@
|
||||
</li>
|
||||
|
||||
<li class="bold hide-on-med-and-down">
|
||||
<a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
|
||||
<i class="{% if entry.isStarred == 0 %}mdi-action-favorite-outline{% else %}mdi-action-favorite{% endif %} small"></i>
|
||||
<span>{{ 'entry.view.left_menu.set_as_favorite'|trans }}</span>
|
||||
<a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
|
||||
<i class="{% if entry.isStarred == 0 %}mdi-toggle-star-outline{% else %}mdi-toggle-star{% endif %} small"></i>
|
||||
<span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
|
||||
</a>
|
||||
<div class="collapsible-body"></div>
|
||||
</li>
|
||||
@ -193,6 +193,15 @@
|
||||
<h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1>
|
||||
</header>
|
||||
<aside>
|
||||
<span class="link mdi-action-today" title="{{ 'entry.view.created_at'|trans }}"> {{ entry.createdAt|date('Y-m-d') }}</span>
|
||||
{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
|
||||
<span class="link mdi-action-query-builder">
|
||||
{% if readingTime > 0 %}
|
||||
{{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
|
||||
{% else %}
|
||||
{{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
|
||||
{% endif %}
|
||||
</span>
|
||||
<a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool link mdi-content-link"> <span>{{ entry.domainName|removeWww }}</span></a>
|
||||
<span class="tool link mdi-communication-comment"> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
|
||||
<div id="list">
|
||||
|
||||
47
src/Wallabag/ImportBundle/Import/AbstractImport.php
Normal file
47
src/Wallabag/ImportBundle/Import/AbstractImport.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Import;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
abstract class AbstractImport implements ImportInterface
|
||||
{
|
||||
protected $em;
|
||||
protected $logger;
|
||||
protected $contentProxy;
|
||||
|
||||
public function __construct(EntityManager $em, ContentProxy $contentProxy)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->logger = new NullLogger();
|
||||
$this->contentProxy = $contentProxy;
|
||||
}
|
||||
|
||||
public function setLogger(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch content from the ContentProxy (using graby).
|
||||
* If it fails return false instead of the updated entry.
|
||||
*
|
||||
* @param Entry $entry Entry to update
|
||||
* @param string $url Url to grab content for
|
||||
* @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
|
||||
*
|
||||
* @return Entry|false
|
||||
*/
|
||||
protected function fetchContent(Entry $entry, $url, array $content = [])
|
||||
{
|
||||
try {
|
||||
return $this->contentProxy->updateEntry($entry, $url, $content);
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
namespace Wallabag\ImportBundle\Import;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use GuzzleHttp\Client;
|
||||
@ -12,12 +11,9 @@ use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
|
||||
class PocketImport implements ImportInterface
|
||||
class PocketImport extends AbstractImport
|
||||
{
|
||||
private $user;
|
||||
private $em;
|
||||
private $contentProxy;
|
||||
private $logger;
|
||||
private $client;
|
||||
private $consumerKey;
|
||||
private $skippedEntries = 0;
|
||||
@ -34,11 +30,6 @@ class PocketImport implements ImportInterface
|
||||
$this->logger = new NullLogger();
|
||||
}
|
||||
|
||||
public function setLogger(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -219,14 +210,20 @@ class PocketImport implements ImportInterface
|
||||
}
|
||||
|
||||
$entry = new Entry($this->user);
|
||||
$entry = $this->contentProxy->updateEntry($entry, $url);
|
||||
$entry = $this->fetchContent($entry, $url);
|
||||
|
||||
// jump to next entry in case of problem while getting content
|
||||
if (false === $entry) {
|
||||
++$this->skippedEntries;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
|
||||
if ($pocketEntry['status'] == 1 || $this->markAsRead) {
|
||||
$entry->setArchived(true);
|
||||
}
|
||||
|
||||
// 0 or 1 - 1 If the item is favorited
|
||||
// 0 or 1 - 1 If the item is starred
|
||||
if ($pocketEntry['favorite'] == 1) {
|
||||
$entry->setStarred(true);
|
||||
}
|
||||
|
||||
@ -2,19 +2,12 @@
|
||||
|
||||
namespace Wallabag\ImportBundle\Import;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
|
||||
abstract class WallabagImport implements ImportInterface
|
||||
abstract class WallabagImport extends AbstractImport
|
||||
{
|
||||
protected $user;
|
||||
protected $em;
|
||||
protected $logger;
|
||||
protected $contentProxy;
|
||||
protected $skippedEntries = 0;
|
||||
protected $importedEntries = 0;
|
||||
protected $filepath;
|
||||
@ -35,18 +28,6 @@ abstract class WallabagImport implements ImportInterface
|
||||
'',
|
||||
];
|
||||
|
||||
public function __construct(EntityManager $em, ContentProxy $contentProxy)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->logger = new NullLogger();
|
||||
$this->contentProxy = $contentProxy;
|
||||
}
|
||||
|
||||
public function setLogger(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* We define the user in a custom call because on the import command there is no logged in user.
|
||||
* So we can't retrieve user from the `security.token_storage` service.
|
||||
@ -159,12 +140,18 @@ abstract class WallabagImport implements ImportInterface
|
||||
|
||||
$data = $this->prepareEntry($importedEntry, $this->markAsRead);
|
||||
|
||||
$entry = $this->contentProxy->updateEntry(
|
||||
$entry = $this->fetchContent(
|
||||
new Entry($this->user),
|
||||
$importedEntry['url'],
|
||||
$data
|
||||
);
|
||||
|
||||
// jump to next entry in case of problem while getting content
|
||||
if (false === $entry) {
|
||||
++$this->skippedEntries;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (array_key_exists('tags', $data)) {
|
||||
$this->contentProxy->assignTagsToEntry(
|
||||
$entry,
|
||||
|
||||
@ -28,16 +28,32 @@ class InstallCommandTest extends WallabagCoreTestCase
|
||||
*
|
||||
* http://stackoverflow.com/a/14374832/569101
|
||||
*/
|
||||
$this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.');
|
||||
$this->markTestSkipped('PostgreSQL spotted: can\'t find a good way to drop current database, skipping.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure next tests will have a clean database
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$application = new Application(static::$kernel);
|
||||
$application->setAutoExit(false);
|
||||
|
||||
$code = $application->run(new ArrayInput([
|
||||
$application->run(new ArrayInput([
|
||||
'command' => 'doctrine:schema:drop',
|
||||
'--no-interaction' => true,
|
||||
'--force' => true,
|
||||
'--env' => 'test',
|
||||
]), new NullOutput());
|
||||
|
||||
$application->run(new ArrayInput([
|
||||
'command' => 'doctrine:schema:create',
|
||||
'--no-interaction' => true,
|
||||
'--env' => 'test',
|
||||
]), new NullOutput());
|
||||
|
||||
$application->run(new ArrayInput([
|
||||
'command' => 'doctrine:fixtures:load',
|
||||
'--no-interaction' => true,
|
||||
'--env' => 'test',
|
||||
|
||||
@ -390,4 +390,55 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertContains('PocketImport: Failed to import', $records[0]['message']);
|
||||
$this->assertEquals('ERROR', $records[0]['level_name']);
|
||||
}
|
||||
|
||||
public function testImportWithExceptionFromGraby()
|
||||
{
|
||||
$client = new Client();
|
||||
|
||||
$mock = new Mock([
|
||||
new Response(200, ['Content-Type' => 'application/json'], Stream::factory(json_encode(['access_token' => 'wunderbar_token']))),
|
||||
new Response(200, ['Content-Type' => 'application/json'], Stream::factory('
|
||||
{
|
||||
"status": 1,
|
||||
"list": {
|
||||
"229279689": {
|
||||
"resolved_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview"
|
||||
}
|
||||
}
|
||||
}
|
||||
')),
|
||||
]);
|
||||
|
||||
$client->getEmitter()->attach($mock);
|
||||
|
||||
$pocketImport = $this->getPocketImport();
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entryRepo->expects($this->once())
|
||||
->method('findByUrlAndUserId')
|
||||
->will($this->onConsecutiveCalls(false, true));
|
||||
|
||||
$this->em
|
||||
->expects($this->once())
|
||||
->method('getRepository')
|
||||
->willReturn($entryRepo);
|
||||
|
||||
$entry = new Entry($this->user);
|
||||
|
||||
$this->contentProxy
|
||||
->expects($this->once())
|
||||
->method('updateEntry')
|
||||
->will($this->throwException(new \Exception()));
|
||||
|
||||
$pocketImport->setClient($client);
|
||||
$pocketImport->authorize('wunderbar_code');
|
||||
|
||||
$res = $pocketImport->import();
|
||||
|
||||
$this->assertTrue($res);
|
||||
$this->assertEquals(['skipped' => 1, 'imported' => 0], $pocketImport->getSummary());
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,4 +143,44 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertContains('WallabagImport: user is not defined', $records[0]['message']);
|
||||
$this->assertEquals('ERROR', $records[0]['level_name']);
|
||||
}
|
||||
|
||||
public function testImportEmptyFile()
|
||||
{
|
||||
$wallabagV2Import = $this->getWallabagV2Import();
|
||||
$wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2-empty.json');
|
||||
|
||||
$res = $wallabagV2Import->import();
|
||||
|
||||
$this->assertFalse($res);
|
||||
$this->assertEquals(['skipped' => 0, 'imported' => 0], $wallabagV2Import->getSummary());
|
||||
}
|
||||
|
||||
public function testImportWithExceptionFromGraby()
|
||||
{
|
||||
$wallabagV2Import = $this->getWallabagV2Import();
|
||||
$wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2.json');
|
||||
|
||||
$entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entryRepo->expects($this->exactly(24))
|
||||
->method('findByUrlAndUserId')
|
||||
->will($this->onConsecutiveCalls(false, true, false));
|
||||
|
||||
$this->em
|
||||
->expects($this->any())
|
||||
->method('getRepository')
|
||||
->willReturn($entryRepo);
|
||||
|
||||
$this->contentProxy
|
||||
->expects($this->exactly(2))
|
||||
->method('updateEntry')
|
||||
->will($this->throwException(new \Exception()));
|
||||
|
||||
$res = $wallabagV2Import->import();
|
||||
|
||||
$this->assertTrue($res);
|
||||
$this->assertEquals(['skipped' => 24, 'imported' => 0], $wallabagV2Import->getSummary());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user