Definition at line 56 of file BlocksTest.php.
◆ testConstruct()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testConstruct |
( |
| ) |
|
Definition at line 60 of file BlocksTest.php.
62 $this->assertInstanceOf(Blocks::class,
new Blocks(
'foo', $this->mock(Container::class), $this->mock(Provide::class)));
◆ testConstructors()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testConstructors |
( |
| ) |
|
Definition at line 65 of file BlocksTest.php.
67 $instance =
new Blocks(
'foo', $this->mock(Container::class), $this->mock(Provide::class));
69 $this->assertInstanceOf(DefaultMappings::class, $instance->defaultMappings());
70 $this->assertInstanceOf(Marshal::class, $instance->marshal());
71 $this->assertInstanceOf(SelectSetting::class, $instance->selectSettingsFrom($this->mock(KeyValueStore::class)));
72 $this->assertInstanceOf(KeyValueStore::class, $instance->readOnlyStore($this->mock(KeyValueStore::class)));
73 $this->assertInstanceOf(KeyValueStore::class, $instance->userStore($this->mock(ilObjUser::class)));
74 $this->assertInstanceOf(KeyValueStore::class, $instance->sessionStore());
75 $this->assertInstanceOf(User::class, $instance->user(
76 $this->mock(Settings::class),
77 $this->mock(UserSettings::class),
78 $this->mock(ilObjUser::class)
◆ testGlobalStore()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testGlobalStore |
( |
| ) |
|
Definition at line 82 of file BlocksTest.php.
84 $instance =
new Blocks(
86 $this->mockMethod(Container::class,
'settings', [], $this->mock(ilSetting::class)),
87 $this->mock(Provide::class)
90 $this->assertInstanceOf(KeyValueStore::class, $instance->globalStore());
◆ testNotAvailable()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testNotAvailable |
( |
| ) |
|
◆ testRetrieveQueryParameter()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testRetrieveQueryParameter |
( |
| ) |
|
Definition at line 117 of file BlocksTest.php.
References $container, $r, and ILIAS\UI\examples\Layout\Page\Standard\$refinery.
122 $refinery = $this->mock(Refinery::class);
123 $transformation = $this->mock(Transformation::class);
125 $container = $this->mockTree(Container::class, [
129 'query' => $this->mockMethod(ArrayBasedRequestWrapper::class,
'retrieve', [
'bar', $transformation], $selected)
134 $instance =
new Blocks(
'foo',
$container, $this->mock(Provide::class));
135 $result = $instance->retrieveQueryParameter(
'bar',
function (
Refinery $r) use (&$called, $transformation,
$refinery):
object {
138 return $transformation;
141 $this->assertSame($selected, $result);
142 $this->assertTrue($called);
◆ testRouting()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testRouting |
( |
| ) |
|
Definition at line 109 of file BlocksTest.php.
References $container.
111 $container = $this->mockMethod(Container::class,
'ctrl', [], $this->mock(ilCtrl::class));
113 $instance =
new Blocks(
'foo',
$container, $this->mock(Provide::class));
114 $this->assertInstanceOf(Routing::class, $instance->routing());
◆ testUi()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testUi |
( |
| ) |
|
Definition at line 94 of file BlocksTest.php.
References $container.
97 $container->expects(self::once())->method(
'ui')->willReturn($this->mock(UIServices::class));
98 $container->expects(self::once())->method(
'language')->willReturn($this->mock(ilLanguage::class));
100 $instance =
new Blocks(
103 $this->mock(Provide::class)
106 $this->assertInstanceOf(UI::class, $instance->ui());
◆ testUserManagementAgreeDateField()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testUserManagementAgreeDateField |
( |
| ) |
|
Definition at line 145 of file BlocksTest.php.
References Vendor\Package\$d, and ILIAS\LegalDocuments\ConsumerToolbox\Blocks\userManagementAgreeDateField().
147 $result = $this->mockTree(Result::class, [
'value' =>
'dummy']);
148 $result->expects(self::once())->method(
'map')->willReturn($result);
149 $result->expects(self::once())->method(
'except')->willReturn($result);
150 $user = $this->mock(ilObjUser::class);
152 $ldoc_user = $this->mockTree(User::class, [
153 'agreeDate' => [
'value' => $date],
154 'acceptedVersion' => $result,
157 $language = $this->mock(ilLanguage::class);
158 $consecutive = [
'dummy lang',
'ldoc'];
159 $language->expects(self::exactly(2))->method(
'loadLanguageModule')->with(
160 $this->callback(
function ($value) use (&$consecutive) {
161 $this->assertSame(array_shift($consecutive), $value);
166 $instance =
new Blocks(
168 $this->mockTree(Container::class, [
'language' => $language]),
169 $this->mock(Provide::class),
171 $this->assertSame($date, $d);
172 return 'formatted date';
175 $proc = $instance->userManagementAgreeDateField(
function (
ilObjUser $u) use ($user, $ldoc_user) {
176 $this->assertSame($user, $u);
178 },
'foo',
'dummy lang');
180 $this->assertSame([
'foo' =>
'dummy'], $proc($user));
◆ testWithoutRequest()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testWithoutRequest |
( |
| ) |
|
Definition at line 204 of file BlocksTest.php.
References $container.
206 $container = $this->mockTree(Container::class, [
207 'http' => [
'request' => [
'getMethod' =>
'GET']],
210 $form = $this->mock(Form::class);
212 $instance =
new Blocks(
'foo',
$container, $this->mock(Provide::class));
213 $result = $instance->withRequest($form, $this->fail(...));
214 $this->assertSame($form, $result);
◆ testWithRequest()
ILIAS\LegalDocuments\test\ConsumerToolbox\BlocksTest::testWithRequest |
( |
| ) |
|
Definition at line 183 of file BlocksTest.php.
References $container, and $data.
188 $container = $this->mockTree(Container::class, [
189 'http' => [
'request' => $this->mockMethod(ServerRequestInterface::class,
'getMethod', [],
'POST')],
192 $form = $this->mock(Form::class);
193 $form->expects(self::once())->method(
'withRequest')->with(
$container->http()->request())->willReturn($form);
194 $form->expects(self::once())->method(
'getData')->willReturn(
$data);
196 $instance =
new Blocks(
'foo',
$container, $this->mock(Provide::class));
197 $this->assertSame($form, $instance->withRequest($form,
function ($x) use (
$data, &$called) {
198 $this->assertSame(
$data, $x);
201 $this->assertTrue($called);
The documentation for this class was generated from the following file: