Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Henvald committed Dec 3, 2021
1 parent 824cce5 commit ba772b8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Resources/translations/validators.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<trans-unit id="1">
<source>password_does_not_meet_special_requirements</source>
<target>Password does not meet requirements. It must contain one lowercase letter, one uppercase letter and one number.</target>
<target>Password does not meet requirements. It must contain one lowercase letter, one uppercase letter and one digit.</target>
</trans-unit>
</body>
</file>
Expand Down
2 changes: 1 addition & 1 deletion Security/AnonymousUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AnonymousUser implements UserInterface
*/
public function getRoles(): array
{
return [];
return [Role::ANONYMOUS];
}

/**
Expand Down
22 changes: 22 additions & 0 deletions Security/Role.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/*
* This file is part of the StfalconApiBundle.
*
* (c) Stfalcon LLC <stfalcon.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace StfalconStudio\ApiBundle\Security;

/**
* Role.
*/
class Role
{
public const ANONYMOUS = 'ROLE_ANONYMOUS';
public const USER = 'ROLE_USER';
}
3 changes: 2 additions & 1 deletion Tests/Security/AnonymousUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use PHPUnit\Framework\TestCase;
use StfalconStudio\ApiBundle\Security\AnonymousUser;
use StfalconStudio\ApiBundle\Security\Role;

final class AnonymousUserTest extends TestCase
{
Expand All @@ -31,7 +32,7 @@ protected function tearDown(): void

public function testConstructor(): void
{
self::assertSame([], $this->anonymousUser->getRoles());
self::assertSame([Role::ANONYMOUS], $this->anonymousUser->getRoles());
self::assertNull($this->anonymousUser->getPassword());
self::assertNull($this->anonymousUser->getSalt());
self::assertSame('anonymous', $this->anonymousUser->getUserIdentifier());
Expand Down

0 comments on commit ba772b8

Please sign in to comment.