55 $this->_objectManager->get(\
Magento\Backend\Model\UrlInterface::class)->turnOffSecretKey();
57 $this->_auth = $this->_objectManager->get(\
Magento\Backend\Model\Auth::class);
58 $this->_session = $this->_auth->getAuthStorage();
60 $this->_auth->login($credentials[
'user'], $credentials[
'password']);
61 $this->_objectManager->get(\
Magento\
Security\Model\Plugin\Auth::class)->afterLogin($this->_auth);
82 $this->_auth->getAuthStorage()->destroy([
'send_expire_cookie' =>
false]);
84 $this->_session =
null;
85 $this->_objectManager->get(\
Magento\Backend\Model\UrlInterface::class)->turnOnSecretKey();
97 \PHPUnit\Framework\Constraint\Constraint
$constraint,
99 $messageManagerClass = \
Magento\Framework\Message\Manager::class
101 parent::assertSessionMessages(
$constraint, $messageType, $messageManagerClass);
109 if ($this->uri ===
null) {
110 $this->markTestIncomplete(
'AclHasAccess test is not complete');
112 if ($this->httpMethod) {
113 $this->
getRequest()->setMethod($this->httpMethod);
115 $this->dispatch($this->uri);
116 $this->assertNotSame(403, $this->
getResponse()->getHttpResponseCode());
117 $this->assertNotSame(404, $this->
getResponse()->getHttpResponseCode());
125 if ($this->resource ===
null) {
126 $this->markTestIncomplete(
'Acl test is not complete');
128 if ($this->httpMethod) {
129 $this->
getRequest()->setMethod($this->httpMethod);
131 $this->_objectManager->get(\
Magento\Framework\Acl\Builder::class)
133 ->deny(
null, $this->resource);
134 $this->dispatch($this->uri);
135 $this->assertSame(403, $this->
getResponse()->getHttpResponseCode());
assertSessionMessages(\PHPUnit\Framework\Constraint\Constraint $constraint, $messageType=null, $messageManagerClass=\Magento\Framework\Message\Manager::class)