mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-31 07:47:28 +01:00
add test for confirmed registration
This commit is contained in:
parent
359b3f43cc
commit
2c13918acc
@ -3,9 +3,7 @@
|
||||
namespace Wallabag\ApiBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
|
||||
class WallabagApiExtension extends Extension
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||
'fos_user_registration_form[plainPassword][first]' => 'mypassword',
|
||||
'fos_user_registration_form[plainPassword][second]' => 'mypassword',
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -101,6 +101,31 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||
$this->assertContains('The user has been created successfully', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function testRegistrationConfirmation()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
$client->followRedirects();
|
||||
|
||||
$user = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:User')
|
||||
->findOneByUsername('newuser');
|
||||
|
||||
$this->assertNull($user->getConfig());
|
||||
|
||||
$client->request('GET', '/register/confirm/b4dT0k3n');
|
||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->request('GET', '/register/confirm/'.$user->getConfirmationToken());
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$user = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:User')
|
||||
->findOneByUsername('newuser');
|
||||
$this->assertNotNull($user->getConfig());
|
||||
}
|
||||
|
||||
public function testLogin()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
|
Loading…
x
Reference in New Issue
Block a user