Definition at line 42 of file DefaultMappingsTest.php.
◆ testConditionDefinitions()
| ILIAS\LegalDocuments\test\DefaultMappingsTest::testConditionDefinitions |
( |
| ) |
|
Definition at line 51 of file DefaultMappingsTest.php.
References $container.
53 $container = $this->mockTree(Container::class, [
55 'factory' => $this->mock(UI::class),
56 'mainTemplate' => $this->mock(ilGlobalTemplateInterface::class),
58 'language' => $this->mockMethod(ilLanguage::class,
'getInstalledLanguages', [], []),
59 'rbac' => $this->mockMethod(RBACServices::class,
'review', [], $this->mock(ilRbacReview::class)),
61 $container->method(
'offsetGet')->with(
'ilObjDataCache')->willReturn($this->mock(ilObjectDataCache::class));
63 $instance =
new DefaultMappings(
'foo',
$container);
64 $result = $instance->conditionDefinitions();
65 $definitions = $result->choices();
66 $this->assertSame(
'usr_country', $result->defaultSelection());
67 $this->assertSame(3, count($definitions));
68 $this->assertInstanceOf(RoleDefinition::class, $definitions[
'usr_global_role']);
69 $this->assertInstanceOf(UserLanguageDefinition::class, $definitions[
'usr_language']);
70 $this->assertInstanceOf(UserCountryDefinition::class, $definitions[
'usr_country']);
◆ testConstruct()
| ILIAS\LegalDocuments\test\DefaultMappingsTest::testConstruct |
( |
| ) |
|
Definition at line 46 of file DefaultMappingsTest.php.
48 $this->assertInstanceOf(DefaultMappings::class,
new DefaultMappings(
'foo', $this->mock(Container::class)));
◆ testContentAsComponent()
| ILIAS\LegalDocuments\test\DefaultMappingsTest::testContentAsComponent |
( |
| ) |
|
Definition at line 73 of file DefaultMappingsTest.php.
References $container.
75 $legacy = $this->mock(Legacy::class);
77 $container = $this->mockTree(Container::class, [
78 'ui' => [
'factory' => $this->mockMethod(UIFactory::class,
'legacy', [
'bar'], $legacy)],
81 $instance =
new DefaultMappings(
'foo',
$container);
82 $map = $instance->contentAsComponent();
83 $this->assertSame([
'html'], array_keys($map));
84 $this->assertSame($legacy, $map[
'html']($this->mockTree(DocumentContent::class, [
'value' =>
'bar'])));
The documentation for this class was generated from the following file: