]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge remote-tracking branch 'origin/master' into 2.3
authorJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 19 May 2017 09:25:19 +0000 (11:25 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 19 May 2017 09:25:19 +0000 (11:25 +0200)
18 files changed:
1  2 
app/config/config.yml
composer.json
src/Wallabag/ApiBundle/Controller/EntryRestController.php
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php

Simple merge
diff --cc composer.json
Simple merge
index 4f49f040f9e6d9ccfb4db6ef0e20fa0c7740b064,0a65f9cee0628a78a38ab6b2fd7ce259c1383371..bf7d373aa94d57f8716ed59f5f6d02f37ccd3b6f
@@@ -372,9 -373,42 +373,42 @@@ class EntryRestControllerTest extends W
          $this->assertEquals('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
          $this->assertEquals(true, $content['is_archived']);
          $this->assertEquals(false, $content['is_starred']);
 -        $this->assertCount(2, $content['tags']);
 +        $this->assertCount(3, $content['tags']);
      }
  
+     public function testPostEntryWhenFetchContentFails()
+     {
+         /** @var \Symfony\Component\DependencyInjection\Container $container */
+         $container = $this->client->getContainer();
+         $contentProxy = $this->getMockBuilder(ContentProxy::class)
+             ->disableOriginalConstructor()
+             ->setMethods(['updateEntry'])
+             ->getMock();
+         $contentProxy->expects($this->any())
+             ->method('updateEntry')
+             ->willThrowException(new \Exception('Test Fetch content fails'));
+         $container->set('wallabag_core.content_proxy', $contentProxy);
+         try {
+             $this->client->request('POST', '/api/entries.json', [
+                 'url' => 'http://www.example.com/',
+             ]);
+             $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
+             $content = json_decode($this->client->getResponse()->getContent(), true);
+             $this->assertGreaterThan(0, $content['id']);
+             $this->assertEquals('http://www.example.com/', $content['url']);
+         } finally {
+             // Remove the created entry to avoid side effects on other tests
+             if (isset($content['id'])) {
+                 $em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
+                 $entry = $em->getReference('WallabagCoreBundle:Entry', $content['id']);
+                 $em->remove($entry);
+                 $em->flush();
+             }
+         }
+     }
      public function testPostArchivedAndStarredEntry()
      {
          $this->client->request('POST', '/api/entries.json', [