ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
InterestedUserFieldChangeListenerTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\User\Tests;
22 
24 
30 {
32 
33  protected function setUp(): void
34  {
35  $this->interestedUserFieldChangeListener = new InterestedUserFieldChangeListener(
36  $this->createMock(\ILIAS\Language\Language::class),
37  'Test name',
38  'Test fieldName'
39  );
40  }
41 
42  public function testGetName(): void
43  {
44  $this->assertEquals(
45  'Test name',
46  $this->interestedUserFieldChangeListener->getName()
47  );
48  }
49 
50  public function testGetFieldName(): void
51  {
52  $this->assertEquals(
53  'Test fieldName',
54  $this->interestedUserFieldChangeListener->getFieldName()
55  );
56  }
57 
58  public function testAddGetAttribute(): void
59  {
60  $interestedUserFieldAttribute = $this->interestedUserFieldChangeListener->addAttribute('ABCD');
61 
62  $this->assertEquals(['ABCD' => $interestedUserFieldAttribute], $this->interestedUserFieldChangeListener->getAttributes());
63  }
64 }
Interface Observer Contains several chained tasks and infos about them.