Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6764f91

Browse filesBrowse files
committed
Merge branch '2.4'
* 2.4: fixed CS fixed CS
2 parents de57903 + 0ac9f85 commit 6764f91
Copy full SHA for 6764f91

File tree

Expand file treeCollapse file tree

7 files changed

+89
-90
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+89
-90
lines changed

‎src/Symfony/Bundle/TwigBundle/TwigEngine.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/TwigEngine.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function guessDefaultEscapingStrategy($filename)
5757
if ('js' === $format) {
5858
return 'js';
5959
}
60-
60+
6161
if ('txt' === $format) {
6262
return false;
6363
}

‎src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
3131
*/
3232
protected $displayErrors;
3333

34-
public function setUp() {
34+
public function setUp()
35+
{
3536
$this->errorReporting = error_reporting(E_ALL | E_STRICT);
3637
$this->displayErrors = ini_get('display_errors');
3738
ini_set('display_errors', '1');
3839
}
3940

40-
public function tearDown() {
41+
public function tearDown()
42+
{
4143
ini_set('display_errors', $this->displayErrors);
4244
error_reporting($this->errorReporting);
4345
}
@@ -287,7 +289,6 @@ public function provideFatalErrorHandlersData()
287289
}
288290
}
289291

290-
291292
function test_namespaced_function_again()
292293
{
293294
}

‎src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Form\Extension\Validator\Constraints;
1313

14-
use Symfony\Component\Form\ClickableInterface;
1514
use Symfony\Component\Form\FormInterface;
1615
use Symfony\Component\Form\Extension\Validator\Util\ServerParams;
1716
use Symfony\Component\Validator\Constraint;

‎src/Symfony/Component/Form/Tests/CompoundFormTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/CompoundFormTest.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
1515
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
16-
use Symfony\Component\Form\FormBuilder;
1716
use Symfony\Component\Form\FormError;
1817
use Symfony\Component\Form\Forms;
1918
use Symfony\Component\Form\FormView;

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,25 +778,25 @@ public function testDayErrorsBubbleUp($widget)
778778
$this->assertSame(array(), $form['day']->getErrors());
779779
$this->assertSame(array($error), $form->getErrors());
780780
}
781-
781+
782782
public function testYearsFor32BitsMachines()
783783
{
784784
if (4 !== PHP_INT_SIZE) {
785785
$this->markTestSkipped(
786786
'PHP must be compiled in 32 bit mode to run this test');
787787
}
788-
788+
789789
$form = $this->factory->create('date', null, array(
790790
'years' => range(1900, 2040),
791791
));
792792

793793
$view = $form->createView();
794794

795795
$listChoices = array();
796-
foreach(range(1902, 2037) as $y) {
796+
foreach (range(1902, 2037) as $y) {
797797
$listChoices[] = new ChoiceView($y, $y, $y);
798798
}
799-
799+
800800
$this->assertEquals($listChoices, $view['year']->vars['choices']);
801801
}
802802
}

‎src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
2424
{
2525

2626
protected function setUp()
27-
{
27+
{
2828
\Locale::setDefault('en');
2929
}
3030

+79-79Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
<?php
2-
3-
/*
4-
* This file is part of the Symfony package.
5-
*
6-
* (c) Fabien Potencier <fabien@symfony.com>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
11-
12-
namespace Symfony\Component\Security\Core\Tests\Authorization;
13-
14-
use Symfony\Component\Security\Core\Authorization\ExpressionLanguage;
15-
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
16-
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
17-
use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
18-
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
19-
use Symfony\Component\Security\Core\User\User;
20-
21-
class ExpressionLanguageTest extends \PHPUnit_Framework_TestCase
22-
{
23-
/**
24-
* @dataProvider provider
25-
*/
26-
public function testIsAuthenticated($token, $expression, $result, array $roles = array())
27-
{
28-
$anonymousTokenClass = 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\AnonymousToken';
29-
$rememberMeTokenClass = 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken';
30-
$expressionLanguage = new ExpressionLanguage();
31-
$trustResolver = new AuthenticationTrustResolver($anonymousTokenClass, $rememberMeTokenClass);
32-
33-
$context = array();
34-
$context['trust_resolver'] = $trustResolver;
35-
$context['token'] = $token;
36-
$context['roles'] = $roles;
37-
38-
$this->assertEquals($result, $expressionLanguage->evaluate($expression, $context));
39-
}
40-
41-
public function provider()
42-
{
43-
$roles = array('ROLE_USER', 'ROLE_ADMIN');
44-
$user = new User('username', 'password', $roles);
45-
46-
$noToken = null;
47-
$anonymousToken = new AnonymousToken('firewall', 'anon.');
48-
$rememberMeToken = new RememberMeToken($user, 'providerkey', 'firewall');
49-
$usernamePasswordToken = new UsernamePasswordToken('username', 'password', 'providerkey', $roles);
50-
51-
return array(
52-
array($noToken, 'is_anonymous()', false),
53-
array($noToken, 'is_authenticated()', false),
54-
array($noToken, 'is_fully_authenticated()', false),
55-
array($noToken, 'is_remember_me()', false),
56-
array($noToken, "has_role('ROLE_USER')", false),
57-
58-
array($anonymousToken, 'is_anonymous()', true),
59-
array($anonymousToken, 'is_authenticated()', false),
60-
array($anonymousToken, 'is_fully_authenticated()', false),
61-
array($anonymousToken, 'is_remember_me()', false),
62-
array($anonymousToken, "has_role('ROLE_USER')", false),
63-
64-
array($rememberMeToken, 'is_anonymous()', false),
65-
array($rememberMeToken, 'is_authenticated()', true),
66-
array($rememberMeToken, 'is_fully_authenticated()', false),
67-
array($rememberMeToken, 'is_remember_me()', true),
68-
array($rememberMeToken, "has_role('ROLE_FOO')", false, $roles),
69-
array($rememberMeToken, "has_role('ROLE_USER')", true, $roles),
70-
71-
array($usernamePasswordToken, 'is_anonymous()', false),
72-
array($usernamePasswordToken, 'is_authenticated()', true),
73-
array($usernamePasswordToken, 'is_fully_authenticated()', true),
74-
array($usernamePasswordToken, 'is_remember_me()', false),
75-
array($usernamePasswordToken, "has_role('ROLE_FOO')", false, $roles),
76-
array($usernamePasswordToken, "has_role('ROLE_USER')", true, $roles),
77-
);
78-
}
79-
}
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Security\Core\Tests\Authorization;
13+
14+
use Symfony\Component\Security\Core\Authorization\ExpressionLanguage;
15+
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
16+
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
17+
use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
18+
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
19+
use Symfony\Component\Security\Core\User\User;
20+
21+
class ExpressionLanguageTest extends \PHPUnit_Framework_TestCase
22+
{
23+
/**
24+
* @dataProvider provider
25+
*/
26+
public function testIsAuthenticated($token, $expression, $result, array $roles = array())
27+
{
28+
$anonymousTokenClass = 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\AnonymousToken';
29+
$rememberMeTokenClass = 'Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken';
30+
$expressionLanguage = new ExpressionLanguage();
31+
$trustResolver = new AuthenticationTrustResolver($anonymousTokenClass, $rememberMeTokenClass);
32+
33+
$context = array();
34+
$context['trust_resolver'] = $trustResolver;
35+
$context['token'] = $token;
36+
$context['roles'] = $roles;
37+
38+
$this->assertEquals($result, $expressionLanguage->evaluate($expression, $context));
39+
}
40+
41+
public function provider()
42+
{
43+
$roles = array('ROLE_USER', 'ROLE_ADMIN');
44+
$user = new User('username', 'password', $roles);
45+
46+
$noToken = null;
47+
$anonymousToken = new AnonymousToken('firewall', 'anon.');
48+
$rememberMeToken = new RememberMeToken($user, 'providerkey', 'firewall');
49+
$usernamePasswordToken = new UsernamePasswordToken('username', 'password', 'providerkey', $roles);
50+
51+
return array(
52+
array($noToken, 'is_anonymous()', false),
53+
array($noToken, 'is_authenticated()', false),
54+
array($noToken, 'is_fully_authenticated()', false),
55+
array($noToken, 'is_remember_me()', false),
56+
array($noToken, "has_role('ROLE_USER')", false),
57+
58+
array($anonymousToken, 'is_anonymous()', true),
59+
array($anonymousToken, 'is_authenticated()', false),
60+
array($anonymousToken, 'is_fully_authenticated()', false),
61+
array($anonymousToken, 'is_remember_me()', false),
62+
array($anonymousToken, "has_role('ROLE_USER')", false),
63+
64+
array($rememberMeToken, 'is_anonymous()', false),
65+
array($rememberMeToken, 'is_authenticated()', true),
66+
array($rememberMeToken, 'is_fully_authenticated()', false),
67+
array($rememberMeToken, 'is_remember_me()', true),
68+
array($rememberMeToken, "has_role('ROLE_FOO')", false, $roles),
69+
array($rememberMeToken, "has_role('ROLE_USER')", true, $roles),
70+
71+
array($usernamePasswordToken, 'is_anonymous()', false),
72+
array($usernamePasswordToken, 'is_authenticated()', true),
73+
array($usernamePasswordToken, 'is_fully_authenticated()', true),
74+
array($usernamePasswordToken, 'is_remember_me()', false),
75+
array($usernamePasswordToken, "has_role('ROLE_FOO')", false, $roles),
76+
array($usernamePasswordToken, "has_role('ROLE_USER')", true, $roles),
77+
);
78+
}
79+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.