+ 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);
+
+ $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']);
+ }
+