1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +00:00

Merge remote-tracking branch 'origin/master' into 2.2

This commit is contained in:
Jeremy Benoist 2016-10-24 12:03:17 +02:00
commit 64a8781e45
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
82 changed files with 654 additions and 1569 deletions

View file

@ -359,11 +359,49 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $em
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
->find($content->getId());
$this->assertNotEmpty($content->getContent());
}
/**
* @depends testPostNewOk
*/
public function testReloadWithFetchingFailed()
{
$this->logInAs('admin');
$client = $this->getClient();
$em = $client->getContainer()
->get('doctrine.orm.entity_manager');
$content = $em
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
// put a known failed url
$content->setUrl('http://0.0.0.0/failed.html');
$em->persist($content);
$em->flush();
$client->request('GET', '/reload/'.$content->getId());
$this->assertEquals(302, $client->getResponse()->getStatusCode());
// force EntityManager to clear previous entity
// otherwise, retrieve the same entity will retrieve change from the previous request :0
$em->clear();
$newContent = $em
->getRepository('WallabagCoreBundle:Entry')
->find($content->getId());
$newContent->setUrl($this->url);
$em->persist($newContent);
$em->flush();
$this->assertNotEquals($client->getContainer()->getParameter('wallabag_core.fetching_error_message'), $newContent->getContent());
}
public function testEdit()
{
$this->logInAs('admin');