ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
SessionAuthenticatedSubjectResolverTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29use PHPUnit\Framework\TestCase;
30
32{
34 {
36
37 self::assertSame(AuthenticatedUserSubjectProvider::NAME, $resolver->subject()->id()->provider());
38 self::assertSame('42', $resolver->subject()->id()->id());
39 self::assertTrue($resolver->supportsPersistentStorage());
40 }
41
43 {
45 $this->user(new Error('No authenticated user in session.')),
47 );
48
49 self::assertTrue($resolver->subject()->isAnonymous());
50 self::assertFalse($resolver->supportsPersistentStorage());
51 }
52
54 {
56
57 self::assertTrue($resolver->subject()->isAnonymous());
58 self::assertFalse($resolver->supportsPersistentStorage());
59 }
60
61 private function user(Result $id): AuthenticatedUser
62 {
63 $user = $this->createStub(AuthenticatedUser::class);
64 $user->method('id')->willReturn($id);
65
66 return $user;
67 }
68}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
foreach($components as $component) $resolver
Names the fully authenticated ILIAS users as KeyValueStorage subjects; the subject id is the user id.
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Ok.php:31
Query port for a fully authenticated ILIAS user in the current request.
A result encapsulates a value or an error and simplifies the handling of those.
Definition: Result.php:29