diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-02-10 16:26:37 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-02-10 16:26:37 +0100 |
commit | 2f1aeb2cdba0ee1809dab7ec0d2cafaaa7100a45 (patch) | |
tree | d80744c7b59c6e0b36bd0a349780a91f8317a337 | |
parent | 9b6d5041afee4c5e379c56f3cf2111b989c6c24b (diff) | |
parent | 7efc95077540fd649e1dbd98fb498461be1254ca (diff) | |
download | symfony-security-2f1aeb2cdba0ee1809dab7ec0d2cafaaa7100a45.zip symfony-security-2f1aeb2cdba0ee1809dab7ec0d2cafaaa7100a45.tar.gz symfony-security-2f1aeb2cdba0ee1809dab7ec0d2cafaaa7100a45.tar.bz2 |
Merge branch '2.7'
* 2.7:
fixed deprecation notice
removed usage of the deprecated forms of asset() in the core framework
renamed asset_path() to asset() and added a BC layer
[Asset] added a NullContext class
[Asset] added the component
Added new Forwarded header support for Request::getClientIps
Optimize EntityType by only loading choices for values in the same way that EntityLoader customization does (if you provide a query_builder).
[Security] added string representation for core Users
Add Twig loader priority
Conflicts:
src/Symfony/Bundle/FrameworkBundle/composer.json
src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
-rw-r--r-- | Core/Tests/User/UserTest.php | 9 | ||||
-rw-r--r-- | Core/User/User.php | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Core/Tests/User/UserTest.php b/Core/Tests/User/UserTest.php index 2fe6daa..f514eda 100644 --- a/Core/Tests/User/UserTest.php +++ b/Core/Tests/User/UserTest.php @@ -123,4 +123,13 @@ class UserTest extends \PHPUnit_Framework_TestCase $user->eraseCredentials(); $this->assertEquals('superpass', $user->getPassword()); } + + /** + * @covers Symfony\Component\Security\Core\User\User::__toString + */ + public function testToString() + { + $user = new User('fabien', 'superpass'); + $this->assertEquals('fabien', (string) $user); + } } diff --git a/Core/User/User.php b/Core/User/User.php index ea2c6a4..d458b72 100644 --- a/Core/User/User.php +++ b/Core/User/User.php @@ -43,6 +43,11 @@ final class User implements AdvancedUserInterface $this->roles = $roles; } + public function __toString() + { + return $this->getUsername(); + } + /** * {@inheritdoc} */ |