Add flashes messages

This commit is contained in:
Jeremy Benoist
2016-03-11 14:48:46 +01:00
parent 4f9cf232f8
commit 4204a06b77
11 changed files with 94 additions and 40 deletions

View File

@ -37,6 +37,6 @@ class PocketControllerTest extends WallabagCoreTestCase
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$this->assertContains('import/pocket', $client->getResponse()->headers->get('location'));
$this->assertEquals('Import failed, please try again.', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
$this->assertEquals('flashes.import.notice.failed', $client->getContainer()->get('session')->getFlashBag()->peek('notice')[0]);
}
}

View File

@ -55,7 +55,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content->getTags()->contains($tag));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('Import summary', $body[0]);
$this->assertContains('flashes.import.notice.summary', $body[0]);
}
public function testImportWallabagWithFileAndMarkAllAsRead()
@ -100,7 +100,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('Import summary', $body[0]);
$this->assertContains('flashes.import.notice.summary', $body[0]);
}
public function testImportWallabagWithEmptyFile()
@ -124,6 +124,6 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('Import failed, please try again', $body[0]);
$this->assertContains('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -40,7 +40,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('Import summary', $body[0]);
$this->assertContains('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -88,6 +88,6 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertContains('Import failed, please try again', $body[0]);
$this->assertContains('flashes.import.notice.failed', $body[0]);
}
}