ILIAS  release_8 Revision v8.24
InterestedUserFieldAttributeTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
23
29{
31
32 protected function setUp(): void
33 {
34 global $DIC;
35
36 $DIC = new Container();
37
38 $GLOBALS["lng"] = $this->createMock(ilLanguage::class);
39 unset($DIC["lng"]);
40 $DIC["lng"] = $GLOBALS["lng"];
41
42 $this->interestedUserFieldAttribute = new InterestedUserFieldAttribute("ABCD", "EFGH");
43 }
44
45 public function testGetAttributeName(): void
46 {
47 $this->assertEquals("ABCD", $this->interestedUserFieldAttribute->getAttributeName());
48 }
49
50 public function testGetFieldName(): void
51 {
52 $this->assertEquals("INVALID TRANSLATION KEY", $this->interestedUserFieldAttribute->getName());
53 }
54
55 public function testAddGetComponent(): void
56 {
57 $interestedComponent = $this->interestedUserFieldAttribute->addComponent(
58 "comp name",
59 "Description"
60 );
61
62 $this->assertEquals([$interestedComponent], $this->interestedUserFieldAttribute->getComponents());
63 }
64}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class InterestedUserFieldAttributeTest.
InterestedUserFieldAttribute $interestedUserFieldAttribute
global $DIC
Definition: feed.php:28