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:
commit
64a8781e45
82 changed files with 654 additions and 1569 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue