diff options
18 files changed, 52 insertions, 30 deletions
diff --git a/app/config/config.yml b/app/config/config.yml index d37ed227..b76fb696 100644 --- a/app/config/config.yml +++ b/app/config/config.yml | |||
@@ -350,3 +350,10 @@ fos_js_routing: | |||
350 | - howto | 350 | - howto |
351 | - fos_user_security_logout | 351 | - fos_user_security_logout |
352 | - new | 352 | - new |
353 | |||
354 | jms_serializer: | ||
355 | handlers: | ||
356 | # to be removed if we switch to (default) ISO8601 datetime instead of ATOM | ||
357 | # see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494 | ||
358 | datetime: | ||
359 | default_format: "Y-m-d\\TH:i:sO" # ATOM | ||
diff --git a/composer.json b/composer.json index fa0a4a39..d1f970c7 100644 --- a/composer.json +++ b/composer.json | |||
@@ -43,7 +43,7 @@ | |||
43 | "ext-iconv": "*", | 43 | "ext-iconv": "*", |
44 | "ext-tokenizer": "*", | 44 | "ext-tokenizer": "*", |
45 | "ext-pdo": "*", | 45 | "ext-pdo": "*", |
46 | "symfony/symfony": "3.2.*", | 46 | "symfony/symfony": "3.3.*", |
47 | "doctrine/orm": "^2.5", | 47 | "doctrine/orm": "^2.5", |
48 | "doctrine/doctrine-bundle": "^1.6", | 48 | "doctrine/doctrine-bundle": "^1.6", |
49 | "doctrine/doctrine-cache-bundle": "^1.2", | 49 | "doctrine/doctrine-cache-bundle": "^1.2", |
@@ -51,15 +51,15 @@ | |||
51 | "symfony/swiftmailer-bundle": "^2.3", | 51 | "symfony/swiftmailer-bundle": "^2.3", |
52 | "symfony/monolog-bundle": "^3.0", | 52 | "symfony/monolog-bundle": "^3.0", |
53 | "sensio/distribution-bundle": "^5.0", | 53 | "sensio/distribution-bundle": "^5.0", |
54 | "sensio/framework-extra-bundle": "^3.0.2", | 54 | "sensio/framework-extra-bundle": "^3.0", |
55 | "incenteev/composer-parameter-handler": "^2.0", | 55 | "incenteev/composer-parameter-handler": "^2.0", |
56 | "nelmio/cors-bundle": "~1.4.0", | 56 | "nelmio/cors-bundle": "~1.4", |
57 | "friendsofsymfony/rest-bundle": "~2.1", | 57 | "friendsofsymfony/rest-bundle": "~2.1", |
58 | "jms/serializer-bundle": "~1.1", | 58 | "jms/serializer-bundle": "~2.2", |
59 | "nelmio/api-doc-bundle": "~2.7", | 59 | "nelmio/api-doc-bundle": "~2.7", |
60 | "mgargano/simplehtmldom": "~1.5", | 60 | "mgargano/simplehtmldom": "~1.5", |
61 | "wallabag/tcpdf": "^6.2", | 61 | "wallabag/tcpdf": "^6.2", |
62 | "simplepie/simplepie": "~1.3.1", | 62 | "simplepie/simplepie": "~1.5", |
63 | "willdurand/hateoas-bundle": "~1.0", | 63 | "willdurand/hateoas-bundle": "~1.0", |
64 | "liip/theme-bundle": "~1.1", | 64 | "liip/theme-bundle": "~1.1", |
65 | "lexik/form-filter-bundle": "~5.0", | 65 | "lexik/form-filter-bundle": "~5.0", |
@@ -89,12 +89,12 @@ | |||
89 | }, | 89 | }, |
90 | "require-dev": { | 90 | "require-dev": { |
91 | "doctrine/doctrine-fixtures-bundle": "~2.2", | 91 | "doctrine/doctrine-fixtures-bundle": "~2.2", |
92 | "doctrine/data-fixtures": "~1.1.1", | 92 | "doctrine/data-fixtures": "~1.1", |
93 | "sensio/generator-bundle": "^3.0", | 93 | "sensio/generator-bundle": "^3.0", |
94 | "symfony/phpunit-bridge": "^3.3", | 94 | "symfony/phpunit-bridge": "^3.3", |
95 | "friendsofphp/php-cs-fixer": "~2.0", | 95 | "friendsofphp/php-cs-fixer": "~2.0", |
96 | "m6web/redis-mock": "^2.0", | 96 | "m6web/redis-mock": "^2.0", |
97 | "dama/doctrine-test-bundle": "^1.0" | 97 | "dama/doctrine-test-bundle": "^3.0" |
98 | }, | 98 | }, |
99 | "scripts": { | 99 | "scripts": { |
100 | "post-cmd": [ | 100 | "post-cmd": [ |
diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8f5285e6..591b0909 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist | |||
@@ -32,6 +32,6 @@ | |||
32 | </filter> | 32 | </filter> |
33 | 33 | ||
34 | <listeners> | 34 | <listeners> |
35 | <listener class="\DAMA\DoctrineTestBundle\PHPUnit\PHPUnitStaticDbConnectionListener" /> | 35 | <listener class="\DAMA\DoctrineTestBundle\PHPUnit\LegacyPHPUnitListener" /> |
36 | </listeners> | 36 | </listeners> |
37 | </phpunit> | 37 | </phpunit> |
diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index 8d7b6ee9..f3090e65 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php | |||
@@ -31,7 +31,7 @@ class WallabagAnnotationController extends FOSRestController | |||
31 | $total = count($annotationRows); | 31 | $total = count($annotationRows); |
32 | $annotations = ['total' => $total, 'rows' => $annotationRows]; | 32 | $annotations = ['total' => $total, 'rows' => $annotationRows]; |
33 | 33 | ||
34 | $json = $this->get('serializer')->serialize($annotations, 'json'); | 34 | $json = $this->get('jms_serializer')->serialize($annotations, 'json'); |
35 | 35 | ||
36 | return (new JsonResponse())->setJson($json); | 36 | return (new JsonResponse())->setJson($json); |
37 | } | 37 | } |
@@ -64,7 +64,7 @@ class WallabagAnnotationController extends FOSRestController | |||
64 | $em->persist($annotation); | 64 | $em->persist($annotation); |
65 | $em->flush(); | 65 | $em->flush(); |
66 | 66 | ||
67 | $json = $this->get('serializer')->serialize($annotation, 'json'); | 67 | $json = $this->get('jms_serializer')->serialize($annotation, 'json'); |
68 | 68 | ||
69 | return JsonResponse::fromJsonString($json); | 69 | return JsonResponse::fromJsonString($json); |
70 | } | 70 | } |
@@ -99,7 +99,7 @@ class WallabagAnnotationController extends FOSRestController | |||
99 | $em->persist($annotation); | 99 | $em->persist($annotation); |
100 | $em->flush(); | 100 | $em->flush(); |
101 | 101 | ||
102 | $json = $this->get('serializer')->serialize($annotation, 'json'); | 102 | $json = $this->get('jms_serializer')->serialize($annotation, 'json'); |
103 | 103 | ||
104 | return JsonResponse::fromJsonString($json); | 104 | return JsonResponse::fromJsonString($json); |
105 | } | 105 | } |
@@ -124,7 +124,7 @@ class WallabagAnnotationController extends FOSRestController | |||
124 | $em->remove($annotation); | 124 | $em->remove($annotation); |
125 | $em->flush(); | 125 | $em->flush(); |
126 | 126 | ||
127 | $json = $this->get('serializer')->serialize($annotation, 'json'); | 127 | $json = $this->get('jms_serializer')->serialize($annotation, 'json'); |
128 | 128 | ||
129 | return (new JsonResponse())->setJson($json); | 129 | return (new JsonResponse())->setJson($json); |
130 | } | 130 | } |
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 6db97731..86e72335 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -752,7 +752,7 @@ class EntryRestController extends WallabagRestController | |||
752 | $context = new SerializationContext(); | 752 | $context = new SerializationContext(); |
753 | $context->setSerializeNull(true); | 753 | $context->setSerializeNull(true); |
754 | 754 | ||
755 | $json = $this->get('serializer')->serialize($data, 'json', $context); | 755 | $json = $this->get('jms_serializer')->serialize($data, 'json', $context); |
756 | 756 | ||
757 | return (new JsonResponse())->setJson($json); | 757 | return (new JsonResponse())->setJson($json); |
758 | } | 758 | } |
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index efa4e8cf..d19f1228 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php | |||
@@ -25,7 +25,7 @@ class TagRestController extends WallabagRestController | |||
25 | ->getRepository('WallabagCoreBundle:Tag') | 25 | ->getRepository('WallabagCoreBundle:Tag') |
26 | ->findAllTags($this->getUser()->getId()); | 26 | ->findAllTags($this->getUser()->getId()); |
27 | 27 | ||
28 | $json = $this->get('serializer')->serialize($tags, 'json'); | 28 | $json = $this->get('jms_serializer')->serialize($tags, 'json'); |
29 | 29 | ||
30 | return (new JsonResponse())->setJson($json); | 30 | return (new JsonResponse())->setJson($json); |
31 | } | 31 | } |
@@ -58,7 +58,7 @@ class TagRestController extends WallabagRestController | |||
58 | 58 | ||
59 | $this->cleanOrphanTag($tag); | 59 | $this->cleanOrphanTag($tag); |
60 | 60 | ||
61 | $json = $this->get('serializer')->serialize($tag, 'json'); | 61 | $json = $this->get('jms_serializer')->serialize($tag, 'json'); |
62 | 62 | ||
63 | return (new JsonResponse())->setJson($json); | 63 | return (new JsonResponse())->setJson($json); |
64 | } | 64 | } |
@@ -100,7 +100,7 @@ class TagRestController extends WallabagRestController | |||
100 | 100 | ||
101 | $this->cleanOrphanTag($tags); | 101 | $this->cleanOrphanTag($tags); |
102 | 102 | ||
103 | $json = $this->get('serializer')->serialize($tags, 'json'); | 103 | $json = $this->get('jms_serializer')->serialize($tags, 'json'); |
104 | 104 | ||
105 | return (new JsonResponse())->setJson($json); | 105 | return (new JsonResponse())->setJson($json); |
106 | } | 106 | } |
@@ -126,7 +126,7 @@ class TagRestController extends WallabagRestController | |||
126 | 126 | ||
127 | $this->cleanOrphanTag($tag); | 127 | $this->cleanOrphanTag($tag); |
128 | 128 | ||
129 | $json = $this->get('serializer')->serialize($tag, 'json'); | 129 | $json = $this->get('jms_serializer')->serialize($tag, 'json'); |
130 | 130 | ||
131 | return (new JsonResponse())->setJson($json); | 131 | return (new JsonResponse())->setJson($json); |
132 | } | 132 | } |
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 6f47cff0..a1378fc5 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php | |||
@@ -46,7 +46,7 @@ class UserRestController extends WallabagRestController | |||
46 | public function putUserAction(Request $request) | 46 | public function putUserAction(Request $request) |
47 | { | 47 | { |
48 | if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { | 48 | if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { |
49 | $json = $this->get('serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); | 49 | $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); |
50 | 50 | ||
51 | return (new JsonResponse()) | 51 | return (new JsonResponse()) |
52 | ->setJson($json) | 52 | ->setJson($json) |
@@ -92,7 +92,7 @@ class UserRestController extends WallabagRestController | |||
92 | $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']); | 92 | $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']); |
93 | } | 93 | } |
94 | 94 | ||
95 | $json = $this->get('serializer')->serialize(['error' => $errors], 'json'); | 95 | $json = $this->get('jms_serializer')->serialize(['error' => $errors], 'json'); |
96 | 96 | ||
97 | return (new JsonResponse()) | 97 | return (new JsonResponse()) |
98 | ->setJson($json) | 98 | ->setJson($json) |
@@ -127,7 +127,7 @@ class UserRestController extends WallabagRestController | |||
127 | */ | 127 | */ |
128 | private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK) | 128 | private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK) |
129 | { | 129 | { |
130 | $json = $this->get('serializer')->serialize( | 130 | $json = $this->get('jms_serializer')->serialize( |
131 | $user, | 131 | $user, |
132 | 'json', | 132 | 'json', |
133 | SerializationContext::create()->setGroups([$group]) | 133 | SerializationContext::create()->setGroups([$group]) |
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 71da2a64..7d8cfbba 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -19,7 +19,7 @@ class WallabagRestController extends FOSRestController | |||
19 | public function getVersionAction() | 19 | public function getVersionAction() |
20 | { | 20 | { |
21 | $version = $this->container->getParameter('wallabag_core.version'); | 21 | $version = $this->container->getParameter('wallabag_core.version'); |
22 | $json = $this->get('serializer')->serialize($version, 'json'); | 22 | $json = $this->get('jms_serializer')->serialize($version, 'json'); |
23 | 23 | ||
24 | return (new JsonResponse())->setJson($json); | 24 | return (new JsonResponse())->setJson($json); |
25 | } | 25 | } |
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 33bfa71e..907814df 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -1268,7 +1268,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1268 | 'ru', | 1268 | 'ru', |
1269 | ], | 1269 | ], |
1270 | 'fr-FR' => [ | 1270 | 'fr-FR' => [ |
1271 | 'http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', | 1271 | 'https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', |
1272 | 'fr_FR', | 1272 | 'fr_FR', |
1273 | ], | 1273 | ], |
1274 | 'de' => [ | 1274 | 'de' => [ |
@@ -1300,7 +1300,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1300 | null, | 1300 | null, |
1301 | ], | 1301 | ], |
1302 | 'es-ES' => [ | 1302 | 'es-ES' => [ |
1303 | 'http://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google/', | 1303 | 'https://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google/', |
1304 | 'es_ES', | 1304 | 'es_ES', |
1305 | ], | 1305 | ], |
1306 | ]; | 1306 | ]; |
diff --git a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php index 3873ccf4..ddb7a65a 100644 --- a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php | |||
@@ -114,10 +114,11 @@ class ChromeControllerTest extends WallabagCoreTestCase | |||
114 | ->get('doctrine.orm.entity_manager') | 114 | ->get('doctrine.orm.entity_manager') |
115 | ->getRepository('WallabagCoreBundle:Entry') | 115 | ->getRepository('WallabagCoreBundle:Entry') |
116 | ->findByUrlAndUserId( | 116 | ->findByUrlAndUserId( |
117 | 'http://www.usinenouvelle.com/article/la-multiplication-des-chefs-de-projet-est-une-catastrophe-manageriale-majeure-affirme-le-sociologue-francois-dupuy.N307730', | 117 | 'https://www.usinenouvelle.com/article/la-multiplication-des-chefs-de-projet-est-une-catastrophe-manageriale-majeure-affirme-le-sociologue-francois-dupuy.N307730', |
118 | $this->getLoggedInUserId() | 118 | $this->getLoggedInUserId() |
119 | ); | 119 | ); |
120 | 120 | ||
121 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
121 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok'); | 122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok'); |
122 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok'); | 123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok'); |
123 | $this->assertSame(1, count($content->getTags())); | 124 | $this->assertSame(1, count($content->getTags())); |
diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php index 5e1260b1..933fffa2 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php | |||
@@ -118,6 +118,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
118 | $this->getLoggedInUserId() | 118 | $this->getLoggedInUserId() |
119 | ); | 119 | ); |
120 | 120 | ||
121 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok'); | 122 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok'); |
122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok'); | 123 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok'); |
123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok'); | 124 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok'); |
@@ -131,6 +132,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
131 | $this->getLoggedInUserId() | 132 | $this->getLoggedInUserId() |
132 | ); | 133 | ); |
133 | 134 | ||
135 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
134 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://stackoverflow.com is ok'); | 136 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://stackoverflow.com is ok'); |
135 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://stackoverflow.com is ok'); | 137 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://stackoverflow.com is ok'); |
136 | $this->assertEmpty($content->getLanguage(), 'Language for https://stackoverflow.com is ok'); | 138 | $this->assertEmpty($content->getLanguage(), 'Language for https://stackoverflow.com is ok'); |
diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php index 9bb59766..1135f32e 100644 --- a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php | |||
@@ -118,6 +118,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
118 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 118 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
119 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 119 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
120 | 120 | ||
121 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok'); | 122 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok'); |
122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok'); | 123 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok'); |
123 | $this->assertNotEmpty($content->getLanguage(), 'Language for https://ma.ttias.be is ok'); | 124 | $this->assertNotEmpty($content->getLanguage(), 'Language for https://ma.ttias.be is ok'); |
@@ -161,6 +162,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
161 | $this->getLoggedInUserId() | 162 | $this->getLoggedInUserId() |
162 | ); | 163 | ); |
163 | 164 | ||
165 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content1); | ||
164 | $this->assertTrue($content1->isArchived()); | 166 | $this->assertTrue($content1->isArchived()); |
165 | 167 | ||
166 | $content2 = $client->getContainer() | 168 | $content2 = $client->getContainer() |
@@ -171,6 +173,7 @@ class PinboardControllerTest extends WallabagCoreTestCase | |||
171 | $this->getLoggedInUserId() | 173 | $this->getLoggedInUserId() |
172 | ); | 174 | ); |
173 | 175 | ||
176 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content2); | ||
174 | $this->assertTrue($content2->isArchived()); | 177 | $this->assertTrue($content2->isArchived()); |
175 | 178 | ||
176 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 179 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index e1915150..fcb9dfab 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php | |||
@@ -111,13 +111,14 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
111 | ->get('doctrine.orm.entity_manager') | 111 | ->get('doctrine.orm.entity_manager') |
112 | ->getRepository('WallabagCoreBundle:Entry') | 112 | ->getRepository('WallabagCoreBundle:Entry') |
113 | ->findByUrlAndUserId( | 113 | ->findByUrlAndUserId( |
114 | 'http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', | 114 | 'https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', |
115 | $this->getLoggedInUserId() | 115 | $this->getLoggedInUserId() |
116 | ); | 116 | ); |
117 | 117 | ||
118 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 118 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
119 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 119 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
120 | 120 | ||
121 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
121 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.zataz.com is ok'); | 122 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.zataz.com is ok'); |
122 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.zataz.com is ok'); | 123 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.zataz.com is ok'); |
123 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.zataz.com is ok'); | 124 | $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.zataz.com is ok'); |
@@ -159,16 +160,18 @@ class ReadabilityControllerTest extends WallabagCoreTestCase | |||
159 | $this->getLoggedInUserId() | 160 | $this->getLoggedInUserId() |
160 | ); | 161 | ); |
161 | 162 | ||
163 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content1); | ||
162 | $this->assertTrue($content1->isArchived()); | 164 | $this->assertTrue($content1->isArchived()); |
163 | 165 | ||
164 | $content2 = $client->getContainer() | 166 | $content2 = $client->getContainer() |
165 | ->get('doctrine.orm.entity_manager') | 167 | ->get('doctrine.orm.entity_manager') |
166 | ->getRepository('WallabagCoreBundle:Entry') | 168 | ->getRepository('WallabagCoreBundle:Entry') |
167 | ->findByUrlAndUserId( | 169 | ->findByUrlAndUserId( |
168 | 'https://facebook.github.io/graphql/', | 170 | 'https://facebook.github.io/graphql/October2016/', |
169 | $this->getLoggedInUserId() | 171 | $this->getLoggedInUserId() |
170 | ); | 172 | ); |
171 | 173 | ||
174 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content2); | ||
172 | $this->assertTrue($content2->isArchived()); | 175 | $this->assertTrue($content2->isArchived()); |
173 | 176 | ||
174 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 177 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 4bc982e0..e0e309b0 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php | |||
@@ -119,6 +119,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
119 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 119 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
120 | $this->assertContains('flashes.import.notice.summary', $body[0]); | 120 | $this->assertContains('flashes.import.notice.summary', $body[0]); |
121 | 121 | ||
122 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
122 | $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is empty'); | 123 | $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is empty'); |
123 | $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is empty'); | 124 | $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is empty'); |
124 | $this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is empty'); | 125 | $this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is empty'); |
@@ -160,6 +161,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
160 | $this->getLoggedInUserId() | 161 | $this->getLoggedInUserId() |
161 | ); | 162 | ); |
162 | 163 | ||
164 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content1); | ||
163 | $this->assertTrue($content1->isArchived()); | 165 | $this->assertTrue($content1->isArchived()); |
164 | 166 | ||
165 | $content2 = $client->getContainer() | 167 | $content2 = $client->getContainer() |
@@ -170,6 +172,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase | |||
170 | $this->getLoggedInUserId() | 172 | $this->getLoggedInUserId() |
171 | ); | 173 | ); |
172 | 174 | ||
175 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content2); | ||
173 | $this->assertTrue($content2->isArchived()); | 176 | $this->assertTrue($content2->isArchived()); |
174 | 177 | ||
175 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); | 178 | $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); |
diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index a94adcaf..e52b9c85 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php | |||
@@ -119,6 +119,8 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
119 | $this->getLoggedInUserId() | 119 | $this->getLoggedInUserId() |
120 | ); | 120 | ); |
121 | 121 | ||
122 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
123 | |||
122 | // empty because it wasn't re-imported | 124 | // empty because it wasn't re-imported |
123 | $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is empty'); | 125 | $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is empty'); |
124 | $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is empty'); | 126 | $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is empty'); |
@@ -136,6 +138,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase | |||
136 | $this->getLoggedInUserId() | 138 | $this->getLoggedInUserId() |
137 | ); | 139 | ); |
138 | 140 | ||
141 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); | ||
139 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok'); | 142 | $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok'); |
140 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok'); | 143 | $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok'); |
141 | $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok'); | 144 | $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok'); |
diff --git a/tests/Wallabag/ImportBundle/fixtures/readability-read.json b/tests/Wallabag/ImportBundle/fixtures/readability-read.json index c60767dc..7dbd9868 100644 --- a/tests/Wallabag/ImportBundle/fixtures/readability-read.json +++ b/tests/Wallabag/ImportBundle/fixtures/readability-read.json | |||
@@ -14,7 +14,7 @@ | |||
14 | "article__excerpt": "The GraphQL Type system describes the capabilities of a GraphQL server and is used to determine if a query is valid. The type system also describes the input types of query variables to determine if…", | 14 | "article__excerpt": "The GraphQL Type system describes the capabilities of a GraphQL server and is used to determine if a query is valid. The type system also describes the input types of query variables to determine if…", |
15 | "favorite": false, | 15 | "favorite": false, |
16 | "date_archived": "2016-07-19T06:48:31", | 16 | "date_archived": "2016-07-19T06:48:31", |
17 | "article__url": "https://facebook.github.io/graphql/", | 17 | "article__url": "https://facebook.github.io/graphql/October2016/", |
18 | "date_added": "2016-06-24T17:50:16", | 18 | "date_added": "2016-06-24T17:50:16", |
19 | "date_favorited": null, | 19 | "date_favorited": null, |
20 | "article__title": "GraphQL", | 20 | "article__title": "GraphQL", |
diff --git a/tests/Wallabag/ImportBundle/fixtures/readability.json b/tests/Wallabag/ImportBundle/fixtures/readability.json index b9fd570d..ba7be5bf 100644 --- a/tests/Wallabag/ImportBundle/fixtures/readability.json +++ b/tests/Wallabag/ImportBundle/fixtures/readability.json | |||
@@ -22,7 +22,7 @@ | |||
22 | "date_added": "2016-09-08T11:55:58+0200", | 22 | "date_added": "2016-09-08T11:55:58+0200", |
23 | "favorite": 0, | 23 | "favorite": 0, |
24 | "article__title": "90% des dossiers médicaux des Coréens du sud vendus à des entreprises privées - ZATAZ", | 24 | "article__title": "90% des dossiers médicaux des Coréens du sud vendus à des entreprises privées - ZATAZ", |
25 | "article__url": "http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/" | 25 | "article__url": "https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/" |
26 | } | 26 | } |
27 | ], | 27 | ], |
28 | "recommendations": [] | 28 | "recommendations": [] |
diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json index 0e30d95b..63c44cf9 100644 --- a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json +++ b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json | |||
@@ -71,14 +71,14 @@ | |||
71 | "is_starred": 0, | 71 | "is_starred": 0, |
72 | "id": 608, | 72 | "id": 608, |
73 | "title": "90% des dossiers médicaux des Coréens du sud vendus à des entreprises privées - ZATAZ", | 73 | "title": "90% des dossiers médicaux des Coréens du sud vendus à des entreprises privées - ZATAZ", |
74 | "url": "http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/", | 74 | "url": "https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/", |
75 | "content": "<p class=\"c2\"><strong>La Corée du Sud vibre en ce moment à la lecture d’une information qui pend aux nez des Français. Une entreprise privée a récupéré 90% des dossiers médicaux des habitants du pays du matin calme au soleil levant pour les revendre.</strong></p>\n<p>Une entreprise spécialisée dans le développement de logiciels en charge de gérer les frais médicaux, programmes utilisés dans les hôpitaux et la Korean Pharmaceutical Information Center, a offert il y a quelques mois ses logiciels de gestion d’officines. Plus de la moitié des pharmacies du pays ont utilisé l’outil. Sauf que <a href=\"http://www.koreaherald.com/view.php?ud=20150726000368\" target=\"_blank\">les données sauvegardées ont été revendues</a> à IMS Health Korea. Cette entreprise, dont le siège social est basé aux USA, a ensuite commercialisé, illégalement, les données à d’autres sociétés en Corée.</p>\n<p>La loi 2011 sur le droit de la protection des renseignements personnels interdit l’utilisation des renseignements personnels et des renseignements médicaux sans le consentement des patients. Le Pharmaceutical Information Center est actuellement jugé pour cette collecte illégale, qui date de 2013, et la distribution des informations médicales de 90% des Coréens.</p>\n<blockquote readability=\"4\">\n<p><strong>Un cas qui pourrait toucher la France ?</strong></p>\n</blockquote>\n<p class=\"c2\">Depuis février 2015, l’ouverture des données de santé dans l’hexagone a été décidée par le législateur. L’assurance-maladie a annoncé qu’elle proposait, en accès libre, sa base de données « <em>Damir</em> » sur le site data.gouv.fr. Un big data de la santé qui regroupe les informations issues de 1,2 milliard de feuilles de soins, de 500 millions d’actes médicaux et de 11 millions d’hospitalisations. Ce big data ne propose pas les identités (pas de nom, de numéro de sécurité sociale, …), uniquement des millions de chiffres et de données de santé. Cette faramineuse base de données, qui double de volume chaque année, permet d’extraire, par exemple, des statistiques liées à la santé dans les régions. <a href=\"http://www.assemblee-nationale.fr/14/amendements/2302/CION-SOC/AS1387.pdf\" target=\"_blank\">L’article 47 de loi</a> permet aux acteurs privés d’accéder aux données de la CNAMTS. C’est l’Institut national des données de santé (<a href=\"http://www.institut-des-donnees-de-sante.fr/\" target=\"_blank\">INDS</a>) qui a en charge de répondre aux demandes du « privé » pour accéder aux données plus ciblées (et payantes).</p>\n", | 75 | "content": "<p class=\"c2\"><strong>La Corée du Sud vibre en ce moment à la lecture d’une information qui pend aux nez des Français. Une entreprise privée a récupéré 90% des dossiers médicaux des habitants du pays du matin calme au soleil levant pour les revendre.</strong></p>\n<p>Une entreprise spécialisée dans le développement de logiciels en charge de gérer les frais médicaux, programmes utilisés dans les hôpitaux et la Korean Pharmaceutical Information Center, a offert il y a quelques mois ses logiciels de gestion d’officines. Plus de la moitié des pharmacies du pays ont utilisé l’outil. Sauf que <a href=\"http://www.koreaherald.com/view.php?ud=20150726000368\" target=\"_blank\">les données sauvegardées ont été revendues</a> à IMS Health Korea. Cette entreprise, dont le siège social est basé aux USA, a ensuite commercialisé, illégalement, les données à d’autres sociétés en Corée.</p>\n<p>La loi 2011 sur le droit de la protection des renseignements personnels interdit l’utilisation des renseignements personnels et des renseignements médicaux sans le consentement des patients. Le Pharmaceutical Information Center est actuellement jugé pour cette collecte illégale, qui date de 2013, et la distribution des informations médicales de 90% des Coréens.</p>\n<blockquote readability=\"4\">\n<p><strong>Un cas qui pourrait toucher la France ?</strong></p>\n</blockquote>\n<p class=\"c2\">Depuis février 2015, l’ouverture des données de santé dans l’hexagone a été décidée par le législateur. L’assurance-maladie a annoncé qu’elle proposait, en accès libre, sa base de données « <em>Damir</em> » sur le site data.gouv.fr. Un big data de la santé qui regroupe les informations issues de 1,2 milliard de feuilles de soins, de 500 millions d’actes médicaux et de 11 millions d’hospitalisations. Ce big data ne propose pas les identités (pas de nom, de numéro de sécurité sociale, …), uniquement des millions de chiffres et de données de santé. Cette faramineuse base de données, qui double de volume chaque année, permet d’extraire, par exemple, des statistiques liées à la santé dans les régions. <a href=\"http://www.assemblee-nationale.fr/14/amendements/2302/CION-SOC/AS1387.pdf\" target=\"_blank\">L’article 47 de loi</a> permet aux acteurs privés d’accéder aux données de la CNAMTS. C’est l’Institut national des données de santé (<a href=\"http://www.institut-des-donnees-de-sante.fr/\" target=\"_blank\">INDS</a>) qui a en charge de répondre aux demandes du « privé » pour accéder aux données plus ciblées (et payantes).</p>\n", |
76 | "annotations": [], | 76 | "annotations": [], |
77 | "mimetype": "text/html", | 77 | "mimetype": "text/html", |
78 | "language": "fr-FR", | 78 | "language": "fr-FR", |
79 | "reading_time": 1, | 79 | "reading_time": 1, |
80 | "domain_name": "www.zataz.com", | 80 | "domain_name": "www.zataz.com", |
81 | "preview_picture": "http://www.zataz.com/wp-content/uploads/HD-Virus.png", | 81 | "preview_picture": "https://www.zataz.com/wp-content/uploads/HD-Virus.png", |
82 | "tags": [] | 82 | "tags": [] |
83 | }, | 83 | }, |
84 | { | 84 | { |