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

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

public testPostLogin ( )
    public function testPostLogin()
    {
        $this->setRequest(Request::create('/bolt/login', 'POST', ['action' => 'login', 'username' => 'test', 'password' => 'pass']));
        $app = $this->getApp();
        $loginMock = $this->getMockLogin();
        $loginMock->expects($this->once())->method('login')->with($this->equalTo('test'), $this->equalTo('pass'))->will($this->returnValue(true));
        $this->setService('access_control.login', $loginMock);
        $this->setSessionUser(new Entity\Users(['username' => 'test', 'roles' => []]));
        $this->addDefaultUser($this->getApp());
        $response = $this->controller()->postLogin($this->getRequest());
        $this->assertTrue($response->isRedirect('/bolt'));
    }