ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 tearDown ()
 
 assertDoesNotThrow (callable $cb, string $message='')
 
 assertThrows (callable $cb, ?string $expected_class=null, ?string $expected_message=null)
 @template T of Throwable More...
 
 setGlobalVariable (string $name, mixed $value)
 
- Protected Attributes inherited from ilCertificateBaseTestCase
Container $dic
 

Detailed Description

Definition at line 23 of file UserCertificateAPITest.php.

Member Function Documentation

◆ testUserDataCall()

UserCertificateAPITest::testUserDataCall ( )

Definition at line 25 of file UserCertificateAPITest.php.

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

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