X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FController%2FConfigControllerTest.php;h=beb0598a969f32dcbe8295a47e98cec18e3adb1a;hb=68cb89a5161351dd730871fc834bf147204a2a07;hp=a2863014fcc82d8cdf4b9f7cebec6800d49bbdcd;hpb=66336f65714433996bb5574662d50d9a8cf03aff;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index a2863014..beb0598a 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php @@ -1,6 +1,6 @@ 1000000000000, ], - 'validator.rss_limit_too_hight', + 'validator.rss_limit_too_high', ], ]; } @@ -515,6 +515,29 @@ class ConfigControllerTest extends WallabagCoreTestCase } } + public function testTaggingRuleTooLong() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/config'); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $form = $crawler->filter('button[id=tagging_rule_save]')->form(); + + $crawler = $client->submit($form, [ + 'tagging_rule[rule]' => str_repeat('title', 60), + 'tagging_rule[tags]' => 'cool tag', + ]); + + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + + $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); + + $this->assertContains('255 characters', $body[0]); + } + public function testDeletingTaggingRuleFromAnOtherUser() { $this->logInAs('bob'); @@ -592,13 +615,13 @@ class ConfigControllerTest extends WallabagCoreTestCase $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('empty'); - $user->setExpired(1); + $user->setEnabled(false); $em->persist($user); $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('bob'); - $user->setExpired(1); + $user->setEnabled(false); $em->persist($user); $em->flush(); @@ -614,13 +637,13 @@ class ConfigControllerTest extends WallabagCoreTestCase $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('empty'); - $user->setExpired(0); + $user->setEnabled(true); $em->persist($user); $user = $em ->getRepository('WallabagUserBundle:User') ->findOneByUsername('bob'); - $user->setExpired(0); + $user->setEnabled(true); $em->persist($user); $em->flush(); @@ -836,4 +859,23 @@ class ConfigControllerTest extends WallabagCoreTestCase $this->assertEmpty($annotationsReset, 'Annotations were reset'); } + + public function testSwitchViewMode() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $client->request('GET', '/unread/list'); + + $this->assertNotContains('listmode', $client->getResponse()->getContent()); + + $client->request('GET', '/config/view-mode'); + $crawler = $client->followRedirect(); + + $client->request('GET', '/unread/list'); + + $this->assertContains('listmode', $client->getResponse()->getContent()); + + $client->request('GET', '/config/view-mode'); + } }