1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Merge pull request #6767 from wallabag/remove-demo

Remove (useless) demo mode
This commit is contained in:
Nicolas Lœuillet 2023-08-21 20:18:18 +02:00 committed by GitHub
commit 407dd48ed0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 29 additions and 119 deletions

View file

@ -2,7 +2,6 @@
namespace Tests\Wallabag\CoreBundle\Controller;
use Craue\ConfigBundle\Util\Config;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
@ -736,36 +735,6 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('You can not access this rule', $body[0]);
}
public function testDemoMode()
{
$this->logInAs('admin');
$client = $this->getTestClient();
$config = $client->getContainer()->get(Config::class);
$config->set('demo_mode_enabled', 1);
$config->set('demo_mode_username', 'admin');
$crawler = $client->request('GET', '/config');
$this->assertSame(200, $client->getResponse()->getStatusCode());
$form = $crawler->filter('button[id=change_passwd_save]')->form();
$data = [
'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'mypassword',
'change_passwd[new_password][second]' => 'mypassword',
];
$client->submit($form, $data);
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertStringContainsString('flashes.config.notice.password_not_updated_demo', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->get('notice')[0]);
$config->set('demo_mode_enabled', 0);
$config->set('demo_mode_username', 'wallabag');
}
public function testDeleteUserButtonVisibility()
{
$this->logInAs('admin');