|
@@ 141-157 (lines=17) @@
|
| 138 |
|
* tests readTopicAction with guest user and enabled login feature |
| 139 |
|
* Tests the index action. |
| 140 |
|
*/ |
| 141 |
|
public function testReadTopicActionWithLoggedOutUserAndEnabledLoginFeature(): void |
| 142 |
|
{ |
| 143 |
|
$topicId = 'someTopicId'; |
| 144 |
|
|
| 145 |
|
$this->featureToggleMock->expects(self::once()) |
| 146 |
|
->method('hasFeature') |
| 147 |
|
->willReturn(true); |
| 148 |
|
$this->authorizationCheckerMock->expects(self::any()) |
| 149 |
|
->method('isGranted') |
| 150 |
|
->willReturn(false); |
| 151 |
|
$this->routerMock->expects(self::once()) |
| 152 |
|
->method('generate') |
| 153 |
|
->with('login_route', []); |
| 154 |
|
|
| 155 |
|
$result = $this->controller->readTopicAction($topicId); |
| 156 |
|
self::assertInstanceOf(RedirectResponse::class, $result); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
/** |
| 160 |
|
* tests readTOpicAction for invalid topic id |
|
@@ 384-400 (lines=17) @@
|
| 381 |
|
/** |
| 382 |
|
* tests readTextnodeAction with guest user and enabled login feature |
| 383 |
|
*/ |
| 384 |
|
public function testReadTextnodeActionWithGuestUserAndEnabledLoginFeature(): void |
| 385 |
|
{ |
| 386 |
|
$textnodeArbitraryId = 'someTopicId'; |
| 387 |
|
|
| 388 |
|
$this->featureToggleMock->expects(self::once()) |
| 389 |
|
->method('hasFeature') |
| 390 |
|
->willReturn(true); |
| 391 |
|
$this->authorizationCheckerMock->expects(self::any()) |
| 392 |
|
->method('isGranted') |
| 393 |
|
->willReturn(false); |
| 394 |
|
$this->routerMock->expects(self::once()) |
| 395 |
|
->method('generate') |
| 396 |
|
->with('login_route', []); |
| 397 |
|
|
| 398 |
|
$result = $this->controller->readTextnodeAction($textnodeArbitraryId); |
| 399 |
|
self::assertInstanceOf(RedirectResponse::class, $result); |
| 400 |
|
} |
| 401 |
|
|
| 402 |
|
/** |
| 403 |
|
* tests readTextnodeAction for invalid Id |