Файл: symfony-2.7/src/Symfony/Component/Security/Http/Tests/Logout/DefaultLogoutSuccessHandlerTest.php
Строк: 48
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SymfonyComponentSecurityHttpTestsLogout;
use SymfonyComponentSecurityHttpLogoutDefaultLogoutSuccessHandler;
class DefaultLogoutSuccessHandlerTest extends PHPUnit_Framework_TestCase
{
public function testLogout()
{
$request = $this->getMock('SymfonyComponentHttpFoundationRequest');
$response = $this->getMock('SymfonyComponentHttpFoundationResponse');
$httpUtils = $this->getMock('SymfonyComponentSecurityHttpHttpUtils');
$httpUtils->expects($this->once())
->method('createRedirectResponse')
->with($request, '/dashboard')
->will($this->returnValue($response));
$handler = new DefaultLogoutSuccessHandler($httpUtils, '/dashboard');
$result = $handler->onLogoutSuccess($request);
$this->assertSame($response, $result);
}
}