Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a78437b

Browse files
committed
Revert "merged branch kriswallsmith/security/demeter-fix (PR #2816)"
This reverts commit 76ba2bc, reversing changes made to 4730f43.
1 parent 466a8b8 commit a78437b

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

src/Symfony/Component/Security/Core/SecurityContext.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,4 @@ public function setToken(TokenInterface $token = null)
9191
{
9292
$this->token = $token;
9393
}
94-
95-
/**
96-
* Returns the current user, if one exists.
97-
*
98-
* @return mixed Returns either an object which implements __toString(),
99-
* or a primitive string if there is a token, otherwise
100-
* returns null.
101-
*/
102-
public function getUser()
103-
{
104-
if ($this->token) {
105-
return $this->token->getUser();
106-
}
107-
}
10894
}

src/Symfony/Component/Security/Core/SecurityContextInterface.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,6 @@ function getToken();
3838
*/
3939
function setToken(TokenInterface $token = null);
4040

41-
/**
42-
* Returns the current user, if one exists.
43-
*
44-
* @return mixed Returns either an object which implements __toString(),
45-
* or a primitive string if there is a token, otherwise
46-
* returns null.
47-
*/
48-
function getUser();
49-
5041
/**
5142
* Checks if the attributes are granted against the current authentication token and optionally supplied object.
5243
*

tests/Symfony/Tests/Component/Security/Core/SecurityContextTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,4 @@ public function testGetSetToken()
8989
$context->setToken($token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'));
9090
$this->assertSame($token, $context->getToken());
9191
}
92-
93-
public function testGetUser()
94-
{
95-
$token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
96-
$token->expects($this->once())
97-
->method('getUser')
98-
->will($this->returnValue('foo'));
99-
100-
$context = new SecurityContext(
101-
$this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'),
102-
$this->getMock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface')
103-
);
104-
105-
$this->assertNull($context->getUser(), '->getUser() returns null when there is no token');
106-
107-
$context->setToken($token);
108-
$this->assertEquals('foo', $context->getUser(), '->getUser() return the token user');
109-
}
11092
}

0 commit comments

Comments
 (0)