mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-19 20:16:18 +00:00
add test for confirmed registration
This commit is contained in:
parent
359b3f43cc
commit
2c13918acc
2 changed files with 26 additions and 3 deletions
|
@ -3,9 +3,7 @@
|
||||||
namespace Wallabag\ApiBundle\DependencyInjection;
|
namespace Wallabag\ApiBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\Config\FileLocator;
|
|
||||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||||
use Symfony\Component\DependencyInjection\Loader;
|
|
||||||
|
|
||||||
class WallabagApiExtension extends Extension
|
class WallabagApiExtension extends Extension
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,7 +78,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||||
'fos_user_registration_form[plainPassword][first]' => 'mypassword',
|
'fos_user_registration_form[plainPassword][first]' => 'mypassword',
|
||||||
'fos_user_registration_form[plainPassword][second]' => '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());
|
$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()
|
public function testLogin()
|
||||||
{
|
{
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
Loading…
Reference in a new issue