Skip to content

Commit 45977bc

Browse files
authored
Merge pull request #108 from magento-arcticfoxes/MC-22176
[arcticfoxes] MC-19649: Granular ACL for B2B modules
2 parents 65763df + b0382ec commit 45977bc

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ abstract class AbstractBackendController extends \Magento\TestFramework\TestCase
4141
*/
4242
protected $httpMethod;
4343

44+
/**
45+
* Expected no access response
46+
*
47+
* @var int
48+
*/
49+
protected $expectedNoAccessResponseCode = 403;
50+
4451
/**
4552
* @inheritDoc
4653
*
@@ -84,21 +91,6 @@ protected function tearDown()
8491
parent::tearDown();
8592
}
8693

87-
/**
88-
* Utilize backend session model by default
89-
*
90-
* @param \PHPUnit\Framework\Constraint\Constraint $constraint
91-
* @param string|null $messageType
92-
* @param string $messageManagerClass
93-
*/
94-
public function assertSessionMessages(
95-
\PHPUnit\Framework\Constraint\Constraint $constraint,
96-
$messageType = null,
97-
$messageManagerClass = \Magento\Framework\Message\Manager::class
98-
) {
99-
parent::assertSessionMessages($constraint, $messageType, $messageManagerClass);
100-
}
101-
10294
/**
10395
* Test ACL configuration for action working.
10496
*/
@@ -111,8 +103,8 @@ public function testAclHasAccess()
111103
$this->getRequest()->setMethod($this->httpMethod);
112104
}
113105
$this->dispatch($this->uri);
114-
$this->assertNotSame(403, $this->getResponse()->getHttpResponseCode());
115106
$this->assertNotSame(404, $this->getResponse()->getHttpResponseCode());
107+
$this->assertNotSame($this->expectedNoAccessResponseCode, $this->getResponse()->getHttpResponseCode());
116108
}
117109

118110
/**
@@ -130,6 +122,6 @@ public function testAclNoAccess()
130122
->getAcl()
131123
->deny(null, $this->resource);
132124
$this->dispatch($this->uri);
133-
$this->assertSame(403, $this->getResponse()->getHttpResponseCode());
125+
$this->assertSame($this->expectedNoAccessResponseCode, $this->getResponse()->getHttpResponseCode());
134126
}
135127
}

0 commit comments

Comments
 (0)