Notifications by SweetAlert2 (#1508)

This commit is contained in:
Kevin Papst
2020-10-02 19:37:30 +02:00
committed by GitHub
parent 0aa6baea2f
commit 825e492891
21 changed files with 161 additions and 62 deletions

View File

@@ -308,10 +308,10 @@ abstract class ControllerBaseTest extends WebTestCase
*/
protected function assertHasFlashSuccess(HttpKernelBrowser $client, string $message = null)
{
$node = $client->getCrawler()->filter('div.alert.alert-success.alert-dismissible');
self::assertGreaterThan(0, $node->count(), 'Could not find flash success message');
$content = $client->getResponse()->getContent();
self::assertStringContainsString('ALERT.success(\'', $content, 'Could not find flash success message');
if (null !== $message) {
self::assertStringContainsString($message, $node->text(null, true));
self::assertStringContainsString($message, $content);
}
}
@@ -321,10 +321,10 @@ abstract class ControllerBaseTest extends WebTestCase
*/
protected function assertHasFlashError(HttpKernelBrowser $client, string $message = null)
{
$node = $client->getCrawler()->filter('div.alert.alert-error.alert-dismissible');
self::assertGreaterThan(0, $node->count(), 'Could not find flash error message');
$content = $client->getResponse()->getContent();
self::assertStringContainsString('ALERT.error(\'', $content, 'Could not find flash error message');
if (null !== $message) {
self::assertStringContainsString($message, $node->text(null, true));
self::assertStringContainsString($message, $content);
}
}