aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/UserBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-07-01 09:52:38 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-07-01 09:52:38 +0200
commitf808b01692a835673f328d7221ba8c212caa9b61 (patch)
tree0c3b1fc5b1ddbd7af72227303503177689e1d403 /tests/Wallabag/UserBundle
parent822c877949aff8ae57677671115f8f4fc69588d5 (diff)
downloadwallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.gz
wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.zst
wallabag-f808b01692a835673f328d7221ba8c212caa9b61.zip
Add a real configuration for CS-Fixer
Diffstat (limited to 'tests/Wallabag/UserBundle')
-rw-r--r--tests/Wallabag/UserBundle/Controller/ManageControllerTest.php16
-rw-r--r--tests/Wallabag/UserBundle/EventListener/AuthenticationFailureListenerTest.php6
-rw-r--r--tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php2
-rw-r--r--tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php4
4 files changed, 14 insertions, 14 deletions
diff --git a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php
index b46256a6..adc2cf09 100644
--- a/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php
+++ b/tests/Wallabag/UserBundle/Controller/ManageControllerTest.php
@@ -12,7 +12,7 @@ class ManageControllerTest extends WallabagCoreTestCase
12 12
13 $client->request('GET', '/users/list'); 13 $client->request('GET', '/users/list');
14 14
15 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 15 $this->assertSame(302, $client->getResponse()->getStatusCode());
16 $this->assertContains('login', $client->getResponse()->headers->get('location')); 16 $this->assertContains('login', $client->getResponse()->headers->get('location'));
17 } 17 }
18 18
@@ -23,16 +23,16 @@ class ManageControllerTest extends WallabagCoreTestCase
23 23
24 // Create a new user in the database 24 // Create a new user in the database
25 $crawler = $client->request('GET', '/users/list'); 25 $crawler = $client->request('GET', '/users/list');
26 $this->assertEquals(200, $client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET /users/'); 26 $this->assertSame(200, $client->getResponse()->getStatusCode(), 'Unexpected HTTP status code for GET /users/');
27 $crawler = $client->click($crawler->selectLink('user.list.create_new_one')->link()); 27 $crawler = $client->click($crawler->selectLink('user.list.create_new_one')->link());
28 28
29 // Fill in the form and submit it 29 // Fill in the form and submit it
30 $form = $crawler->selectButton('user.form.save')->form(array( 30 $form = $crawler->selectButton('user.form.save')->form([
31 'new_user[username]' => 'test_user', 31 'new_user[username]' => 'test_user',
32 'new_user[email]' => 'test@test.io', 32 'new_user[email]' => 'test@test.io',
33 'new_user[plainPassword][first]' => 'testtest', 33 'new_user[plainPassword][first]' => 'testtest',
34 'new_user[plainPassword][second]' => 'testtest', 34 'new_user[plainPassword][second]' => 'testtest',
35 )); 35 ]);
36 36
37 $client->submit($form); 37 $client->submit($form);
38 $client->followRedirect(); 38 $client->followRedirect();
@@ -44,12 +44,12 @@ class ManageControllerTest extends WallabagCoreTestCase
44 // Edit the user 44 // Edit the user
45 $crawler = $client->click($crawler->selectLink('user.list.edit_action')->last()->link()); 45 $crawler = $client->click($crawler->selectLink('user.list.edit_action')->last()->link());
46 46
47 $form = $crawler->selectButton('user.form.save')->form(array( 47 $form = $crawler->selectButton('user.form.save')->form([
48 'user[name]' => 'Foo User', 48 'user[name]' => 'Foo User',
49 'user[username]' => 'test_user', 49 'user[username]' => 'test_user',
50 'user[email]' => 'test@test.io', 50 'user[email]' => 'test@test.io',
51 'user[enabled]' => true, 51 'user[enabled]' => true,
52 )); 52 ]);
53 53
54 $client->submit($form); 54 $client->submit($form);
55 $crawler = $client->followRedirect(); 55 $crawler = $client->followRedirect();
@@ -73,10 +73,10 @@ class ManageControllerTest extends WallabagCoreTestCase
73 $this->logInAs('admin'); 73 $this->logInAs('admin');
74 $client = $this->getClient(); 74 $client = $this->getClient();
75 75
76 $crawler = $client->request('GET', '/users/'.$this->getLoggedInUserId().'/edit'); 76 $crawler = $client->request('GET', '/users/' . $this->getLoggedInUserId() . '/edit');
77 $disabled = $crawler->selectButton('user.form.delete')->extract('disabled'); 77 $disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
78 78
79 $this->assertEquals('disabled', $disabled[0]); 79 $this->assertSame('disabled', $disabled[0]);
80 } 80 }
81 81
82 public function testUserSearch() 82 public function testUserSearch()
diff --git a/tests/Wallabag/UserBundle/EventListener/AuthenticationFailureListenerTest.php b/tests/Wallabag/UserBundle/EventListener/AuthenticationFailureListenerTest.php
index 6191ea13..9e33cdca 100644
--- a/tests/Wallabag/UserBundle/EventListener/AuthenticationFailureListenerTest.php
+++ b/tests/Wallabag/UserBundle/EventListener/AuthenticationFailureListenerTest.php
@@ -2,14 +2,14 @@
2 2
3namespace Tests\Wallabag\UserBundle\EventListener; 3namespace Tests\Wallabag\UserBundle\EventListener;
4 4
5use Monolog\Handler\TestHandler;
6use Monolog\Logger;
5use Symfony\Component\EventDispatcher\EventDispatcher; 7use Symfony\Component\EventDispatcher\EventDispatcher;
6use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
7use Wallabag\UserBundle\EventListener\AuthenticationFailureListener;
8use Monolog\Logger;
9use Monolog\Handler\TestHandler;
10use Symfony\Component\HttpFoundation\RequestStack; 9use Symfony\Component\HttpFoundation\RequestStack;
11use Symfony\Component\Security\Core\AuthenticationEvents; 10use Symfony\Component\Security\Core\AuthenticationEvents;
12use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent; 11use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent;
12use Wallabag\UserBundle\EventListener\AuthenticationFailureListener;
13 13
14class AuthenticationFailureListenerTest extends \PHPUnit_Framework_TestCase 14class AuthenticationFailureListenerTest extends \PHPUnit_Framework_TestCase
15{ 15{
diff --git a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
index 01796ded..e5a145b8 100644
--- a/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
+++ b/tests/Wallabag/UserBundle/EventListener/CreateConfigListenerTest.php
@@ -8,8 +8,8 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
8use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
9use Symfony\Component\HttpFoundation\Response; 9use Symfony\Component\HttpFoundation\Response;
10use Wallabag\CoreBundle\Entity\Config; 10use Wallabag\CoreBundle\Entity\Config;
11use Wallabag\UserBundle\EventListener\CreateConfigListener;
12use Wallabag\UserBundle\Entity\User; 11use Wallabag\UserBundle\Entity\User;
12use Wallabag\UserBundle\EventListener\CreateConfigListener;
13 13
14class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase 14class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
15{ 15{
diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php
index 21412da6..7381ccf1 100644
--- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php
+++ b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php
@@ -68,8 +68,8 @@ TWIG;
68 68
69 $msg = $this->spool->getMessages()[0]; 69 $msg = $this->spool->getMessages()[0];
70 $this->assertArrayHasKey('test@wallabag.io', $msg->getTo()); 70 $this->assertArrayHasKey('test@wallabag.io', $msg->getTo());
71 $this->assertEquals(['nobody@test.io' => 'wallabag test'], $msg->getFrom()); 71 $this->assertSame(['nobody@test.io' => 'wallabag test'], $msg->getFrom());
72 $this->assertEquals('subject', $msg->getSubject()); 72 $this->assertSame('subject', $msg->getSubject());
73 $this->assertContains('text body http://0.0.0.0/support', $msg->toString()); 73 $this->assertContains('text body http://0.0.0.0/support', $msg->toString());
74 $this->assertContains('html body 666666', $msg->toString()); 74 $this->assertContains('html body 666666', $msg->toString());
75 } 75 }