ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
UserCertificateAPITest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 
10 {
11  public function testUserDataCall()
12  {
13  $repository = $this->getMockBuilder(UserDataRepository::class)
14  ->disableOriginalConstructor()
15  ->getMock();
16 
17  $userData = new \Certificate\API\Data\UserCertificateDto(
18  5,
19  'Some Title',
20  100,
21  1234567890,
22  20,
23  'Ilyas',
24  'Homer',
25  'breakdanceMcFunkyPants',
26  'iliyas@ilias.de',
27  'breakdance@funky.de',
28  array(3000)
29  );
30 
31  $repository->method('getUserData')
32  ->willReturn(array(5 => $userData));
33 
34  $api = new \Certificate\API\UserCertificateAPI($repository);
35 
36  $result = $api->getUserCertificateData(new \Certificate\API\Filter\UserDataFilter(array(20, 10 , 11)), array());
37 
38  $this->assertEquals(array('5' => $userData), $result);
39  }
40 }
$result
Class ilCertificateBaseTestCase.