Bolt\Tests\Controller\Backend\AuthenticationTest::testLoginSuccess PHP Метод

testLoginSuccess() публичный Метод

public testLoginSuccess ( )
    public function testLoginSuccess()
    {
        $app = $this->getApp();
        $loginMock = $this->getMockLogin();
        $loginMock->expects($this->once())->method('login')->will($this->returnValue(true));
        $this->setService('access_control.login', $loginMock);
        $this->setSessionUser(new Entity\Users(['username' => 'test', 'roles' => []]));
        $this->setRequest(Request::create('/bolt/login', 'POST', ['action' => 'login']));
        $response = $this->controller()->postLogin($this->getRequest());
        $this->assertRegExp('|Redirecting to /bolt|', $response->getContent());
    }