ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
UserCertificateAPITest Class Reference
+ Inheritance diagram for UserCertificateAPITest:
+ Collaboration diagram for UserCertificateAPITest:

Public Member Functions

 testUserDataCall ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilCertificateBaseTestCase
 setUp ()
 
 setGlobalVariable (string $name, $value)
 
- Protected Attributes inherited from ilCertificateBaseTestCase
Container $dic
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de

Definition at line 26 of file UserCertificateAPITest.php.

Member Function Documentation

◆ testUserDataCall()

UserCertificateAPITest::testUserDataCall ( )

Definition at line 28 of file UserCertificateAPITest.php.

28  : void
29  {
30  $repository = $this->getMockBuilder(UserDataRepository::class)
31  ->disableOriginalConstructor()
32  ->getMock();
33  $logger = new \ILIAS\components\Logging\NullLogger();
34  $database = $this->createMock(ilDBInterface::class);
35 
36  $userData = new \ILIAS\Certificate\API\Data\UserCertificateDto(
37  5,
38  'Some Title',
39  100,
40  1_234_567_890,
41  20,
42  'Ilyas',
43  'Homer',
44  'breakdanceMcFunkyPants',
45  'iliyas@ilias.de',
46  'breakdance@funky.de',
47  [3000]
48  );
49 
50  $repository->method('getUserData')
51  ->willReturn([5 => $userData]);
52 
53  $api = new \ILIAS\Certificate\API\UserCertificateAPI(
54  $repository,
55  $this->createMock(ilCertificateTemplateRepository::class),
57  $database,
58  $logger
59  ),
61  $logger,
62  $this->getMockBuilder(ilObjectDataCache::class)->disableOriginalConstructor()->getMock()
63  );
64 
65  $result = $api->getUserCertificateData(new \ILIAS\Certificate\API\Filter\UserDataFilter(), []);
66 
67  $this->assertSame(['5' => $userData], $result);
68  }
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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