ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\LegalDocuments\test\WiringTest Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\test\WiringTest:
+ Collaboration diagram for ILIAS\LegalDocuments\test\WiringTest:

Public Member Functions

 testConstruct ()
 
 testAfterLogin ()
 
 testShowInFooter ()
 
 testCanWithdraw ()
 
 testShowOnLoginPage ()
 
 testHasAgreement ()
 
 testHasHistory ()
 
 testOnSelfRegistration ()
 
 testHasOnlineStatusFilter ()
 
 testCanReadInternalMails ()
 
 testCanUseSoapApi ()
 
 testHasDocuments ()
 
 testHasUserManagementFields ()
 
 testHasPublicApi ()
 
 testHasPublicPage ()
 
 testHasPublicPageWithGotoLink ()
 
 testMap ()
 

Detailed Description

Definition at line 39 of file WiringTest.php.

Member Function Documentation

◆ testAfterLogin()

ILIAS\LegalDocuments\test\WiringTest::testAfterLogin ( )

Definition at line 48 of file WiringTest.php.

48  : void
49  {
50  $map = $this->mock(Map::class);
51  $proc = $this->fail(...);
52 
53  $instance = new Wiring($this->mock(SlotConstructor::class), $this->mockMethod(Map::class, 'add', ['after-login', $proc], $map));
54  $this->assertSame($map, $instance->afterLogin($proc)->map());
55  }

◆ testCanReadInternalMails()

ILIAS\LegalDocuments\test\WiringTest::testCanReadInternalMails ( )

Definition at line 145 of file WiringTest.php.

145  : void
146  {
147  $map = $this->mock(Map::class);
148  $constraint = $this->mock(Constraint::class);
149 
150  $instance = new Wiring($this->mock(SlotConstructor::class), $this->mockMethod(Map::class, 'add', ['constrain-internal-mail', $constraint], $map));
151  $this->assertSame($map, $instance->canReadInternalMails($constraint)->map());
152  }

◆ testCanUseSoapApi()

ILIAS\LegalDocuments\test\WiringTest::testCanUseSoapApi ( )

Definition at line 154 of file WiringTest.php.

154  : void
155  {
156  $map = $this->mock(Map::class);
157  $constraint = $this->mock(Constraint::class);
158 
159  $instance = new Wiring($this->mock(SlotConstructor::class), $this->mockMethod(Map::class, 'add', ['use-soap-api', $constraint], $map));
160  $this->assertSame($map, $instance->canUseSoapApi($constraint)->map());
161  }

◆ testCanWithdraw()

ILIAS\LegalDocuments\test\WiringTest::testCanWithdraw ( )

Definition at line 66 of file WiringTest.php.

66  : void
67  {
68  $withdraw_process = $this->mock(WithdrawProcess::class);
69 
70  $instance = new Wiring($this->mock(SlotConstructor::class), new Map());
71 
72  $map = $instance->canWithdraw($withdraw_process)->map()->value();
73 
74  $this->assertSame([
75  'withdraw',
76  'logout',
77  'intercept',
78  'logout-text',
79  'show-on-login-page',
80  ], array_keys($map));
81 
82  $this->assertTrue(array_is_list($map['intercept']));
83  $this->assertTrue(array_is_list($map['show-on-login-page']));
84  $this->assertFalse(array_is_list($map['withdraw']));
85  $this->assertFalse(array_is_list($map['logout']));
86  $this->assertFalse(array_is_list($map['logout-text']));
87  }

◆ testConstruct()

ILIAS\LegalDocuments\test\WiringTest::testConstruct ( )

Definition at line 43 of file WiringTest.php.

43  : void
44  {
45  $this->assertInstanceOf(Wiring::class, new Wiring($this->mock(SlotConstructor::class), $this->mock(Map::class)));
46  }

◆ testHasAgreement()

ILIAS\LegalDocuments\test\WiringTest::testHasAgreement ( )

Definition at line 96 of file WiringTest.php.

96  : void
97  {
98  $instance = new Wiring($this->mock(SlotConstructor::class), new Map());
99  $map = $instance->hasAgreement($this->mock(Agreement::class), 'bar')->map()->value();
100 
101  $this->assertSame([
102  'public-page',
103  'agreement-form',
104  'intercept',
105  'goto',
106  ], array_keys($map));
107 
108  $this->assertFalse(array_is_list($map['public-page']));
109  $this->assertFalse(array_is_list($map['agreement-form']));
110  $this->assertTrue(array_is_list($map['intercept']));
111  $this->assertTrue(array_is_list($map['goto']));
112  }

◆ testHasDocuments()

ILIAS\LegalDocuments\test\WiringTest::testHasDocuments ( )

Definition at line 163 of file WiringTest.php.

163  : void
164  {
165  $instance = new Wiring($this->mock(SlotConstructor::class), new Map());
166  $map = $instance->hasDocuments([], new SelectionMap())->map()->value();
167 
168  $this->assertSame([
169  'document',
170  'writable-document',
171  ], array_keys($map));
172 
173  $this->assertFalse(array_is_list($map['document']));
174  $this->assertFalse(array_is_list($map['writable-document']));
175  }

◆ testHasHistory()

ILIAS\LegalDocuments\test\WiringTest::testHasHistory ( )

Definition at line 114 of file WiringTest.php.

114  : void
115  {
116  $document = $this->mock(ProvideDocument::class);
117  $history = $this->mock(ProvideHistory::class);
118  $slot = $this->mockMethod(SlotConstructor::class, 'history', [$document], $history);
119  $slot->method('id')->willReturn('foo');
120  $map = $this->mockTree(Map::class, ['value' => ['document' => ['foo' => $document]]]);
121  $map->expects(self::once())->method('set')->with('history', 'foo', $history)->willReturn($map);
122 
123  $instance = new Wiring($slot, $map);
124  $this->assertSame($map, $instance->hasHistory()->map());
125  }

◆ testHasOnlineStatusFilter()

ILIAS\LegalDocuments\test\WiringTest::testHasOnlineStatusFilter ( )

Definition at line 136 of file WiringTest.php.

136  : void
137  {
138  $map = $this->mock(Map::class);
139  $proc = $this->fail(...);
140 
141  $instance = new Wiring($this->mock(SlotConstructor::class), $this->mockMethod(Map::class, 'add', ['filter-online-users', $proc], $map));
142  $this->assertSame($map, $instance->hasOnlineStatusFilter($proc)->map());
143  }

◆ testHasPublicApi()

ILIAS\LegalDocuments\test\WiringTest::testHasPublicApi ( )

Definition at line 190 of file WiringTest.php.

190  : void
191  {
192  $map = $this->mock(Map::class);
193  $public_api = $this->mock(PublicApi::class);
194 
195  $instance = new Wiring(
196  $this->mockTree(SlotConstructor::class, ['id' => 'foo']),
197  $this->mockMethod(Map::class, 'set', ['public-api', 'foo', $public_api], $map)
198  );
199 
200  $this->assertSame($map, $instance->hasPublicApi($public_api)->map());
201  }

◆ testHasPublicPage()

ILIAS\LegalDocuments\test\WiringTest::testHasPublicPage ( )

Definition at line 203 of file WiringTest.php.

203  : void
204  {
205  $map = $this->mock(Map::class);
206  $public_page = fn() => null;
207 
208  $instance = new Wiring(
209  $this->mockTree(SlotConstructor::class, ['id' => 'foo']),
210  $this->mockMethod(Map::class, 'set', ['public-page', 'foo', $public_page], $map)
211  );
212 
213  $this->assertSame($map, $instance->hasPublicPage($public_page)->map());
214  }

◆ testHasPublicPageWithGotoLink()

ILIAS\LegalDocuments\test\WiringTest::testHasPublicPageWithGotoLink ( )

Definition at line 216 of file WiringTest.php.

216  : void
217  {
218  $m = $this->mock(Map::class);
219  $map = $this->mockMethod(Map::class, 'add', ['goto'], $m);
220  $public_page = fn() => null;
221 
222  $instance = new Wiring(
223  $this->mockTree(SlotConstructor::class, ['id' => 'foo']),
224  $this->mockMethod(Map::class, 'set', ['public-page', 'foo', $public_page], $map)
225  );
226 
227  $this->assertSame($m, $instance->hasPublicPage($public_page, 'foo')->map());
228  }

◆ testHasUserManagementFields()

ILIAS\LegalDocuments\test\WiringTest::testHasUserManagementFields ( )

Definition at line 177 of file WiringTest.php.

177  : void
178  {
179  $map = $this->mock(Map::class);
180  $proc = $this->fail(...);
181 
182  $instance = new Wiring(
183  $this->mockTree(SlotConstructor::class, ['id' => 'foo']),
184  $this->mockMethod(Map::class, 'set', ['user-management-fields', 'foo', $proc], $map)
185  );
186 
187  $this->assertSame($map, $instance->hasUserManagementFields($proc)->map());
188  }

◆ testMap()

ILIAS\LegalDocuments\test\WiringTest::testMap ( )

Definition at line 230 of file WiringTest.php.

230  : void
231  {
232  $map = $this->mock(Map::class);
233  $this->assertSame($map, (new Wiring($this->mock(SlotConstructor::class), $map))->map());
234  }

◆ testOnSelfRegistration()

ILIAS\LegalDocuments\test\WiringTest::testOnSelfRegistration ( )

Definition at line 127 of file WiringTest.php.

127  : void
128  {
129  $map = $this->mock(Map::class);
130  $self_registration = $this->mock(SelfRegistration::class);
131 
132  $instance = new Wiring($this->mock(SlotConstructor::class), $this->mockMethod(Map::class, 'add', ['self-registration', $self_registration], $map));
133  $this->assertSame($map, $instance->onSelfRegistration($self_registration)->map());
134  }

◆ testShowInFooter()

ILIAS\LegalDocuments\test\WiringTest::testShowInFooter ( )

Definition at line 57 of file WiringTest.php.

57  : void
58  {
59  $map = $this->mock(Map::class);
60  $proc = $this->fail(...);
61 
62  $instance = new Wiring($this->mockTree(SlotConstructor::class, ['id' => 'foo']), $this->mockMethod(Map::class, 'set', ['footer', 'foo', $proc], $map));
63  $this->assertSame($map, $instance->showInFooter($proc)->map());
64  }

◆ testShowOnLoginPage()

ILIAS\LegalDocuments\test\WiringTest::testShowOnLoginPage ( )

Definition at line 89 of file WiringTest.php.

89  : void
90  {
91  $proc = $this->fail(...);
92  $instance = new Wiring($this->mockTree(SlotConstructor::class, ['id' => 'foo']), new Map());
93  $this->assertSame(['show-on-login-page' => ['foo' => $proc]], $instance->showOnLoginPage($proc)->map()->value());
94  }

The documentation for this class was generated from the following file: