]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add simple test 2186/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 24 Aug 2016 08:28:43 +0000 (10:28 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 24 Aug 2016 08:28:43 +0000 (10:28 +0200)
tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php

index c0133af4ab6cb7260dade5ca34f03dc9dacf5352..07ff2772e05d4b7f50255975f3d44f4347c8065f 100644 (file)
@@ -33,7 +33,7 @@ class InstallCommandTest extends WallabagCoreTestCase
     }
 
     /**
-     * Ensure next tests will have a clean database
+     * Ensure next tests will have a clean database.
      */
     public static function tearDownAfterClass()
     {
index 03355f5abde2d02820ea5ce842c8938dccbe8dda..08f4676ed010d2b3db60410c6bbc4fe4a057dff4 100644 (file)
@@ -69,4 +69,19 @@ class SecurityControllerTest extends WallabagCoreTestCase
         $this->assertTrue($user->isTrustedComputer('ABCDEF'));
         $this->assertFalse($user->isTrustedComputer('FEDCBA'));
     }
+
+    public function testEnabledRegistration()
+    {
+        $client = $this->getClient();
+
+        if (!$client->getContainer()->getParameter('fosuser_registration')) {
+            $this->markTestSkipped('fosuser_registration is not enabled.');
+
+            return;
+        }
+
+        $client->followRedirects();
+        $crawler = $client->request('GET', '/register');
+        $this->assertContains('registration.submit', $crawler->filter('body')->extract(['_text'])[0]);
+    }
 }