11 $settings = $this->getMockBuilder(
'ilSetting')
12 ->disableOriginalConstructor()
15 $settings->method(
'get')
20 $user = $this->getMockBuilder(
'ilObjUser')
21 ->disableOriginalConstructor()
24 $migrationHelper = $this->getMockBuilder(
'ilCertificateMigration')
25 ->disableOriginalConstructor()
28 $result = $validator->isMigrationAvailable(
$user, $migrationHelper);
35 $settings = $this->getMockBuilder(
'ilSetting')
36 ->disableOriginalConstructor()
39 $settings->method(
'get')
44 $user = $this->getMockBuilder(
'ilObjUser')
45 ->disableOriginalConstructor()
48 $user->method(
'getPref')
49 ->with(
'cert_migr_finished')
52 $migrationHelper = $this->getMockBuilder(
'ilCertificateMigration')
53 ->disableOriginalConstructor()
56 $result = $validator->isMigrationAvailable(
$user, $migrationHelper);
63 $settings = $this->getMockBuilder(
'ilSetting')
64 ->disableOriginalConstructor()
67 $settings->method(
'get')
72 $user = $this->getMockBuilder(
'ilObjUser')
73 ->disableOriginalConstructor()
76 $user->method(
'getPref')
77 ->with(
'cert_migr_finished')
80 $migrationHelper = $this->getMockBuilder(
'ilCertificateMigration')
81 ->disableOriginalConstructor()
84 $migrationHelper->method(
'isTaskRunning')
87 $result = $validator->isMigrationAvailable(
$user, $migrationHelper);
94 $settings = $this->getMockBuilder(
'ilSetting')
95 ->disableOriginalConstructor()
98 $settings->method(
'get')
103 $user = $this->getMockBuilder(
'ilObjUser')
104 ->disableOriginalConstructor()
107 $user->method(
'getPref')
108 ->with(
'cert_migr_finished')
111 $migrationHelper = $this->getMockBuilder(
'ilCertificateMigration')
112 ->disableOriginalConstructor()
115 $migrationHelper->method(
'isTaskRunning')
118 $migrationHelper->method(
'isTaskFinished')
121 $result = $validator->isMigrationAvailable(
$user, $migrationHelper);
128 $settings = $this->getMockBuilder(
'ilSetting')
129 ->disableOriginalConstructor()
132 $settings->method(
'get')
133 ->withConsecutive(array(
'active'), array(
'persisting_cers_introduced_ts'))
134 ->willReturnOnConsecutiveCalls(1, 970000000);
138 $user = $this->getMockBuilder(
'ilObjUser')
139 ->disableOriginalConstructor()
142 $user->method(
'getPref')
143 ->with(
'cert_migr_finished')
146 $user->method(
'getCreateDate')
147 ->willReturn(
'10 September 2000');
149 $migrationHelper = $this->getMockBuilder(
'ilCertificateMigration')
150 ->disableOriginalConstructor()
153 $migrationHelper->method(
'isTaskRunning')
156 $migrationHelper->method(
'isTaskFinished')
159 $result = $validator->isMigrationAvailable(
$user, $migrationHelper);
testMigrationTaskIsAlreadyRunningWillResultInFalse()
testCertificatesAreNotGloballyAvailableWillResultInFalse()
testMigrationIsAvailable()
testCertificatesAlreadyMigratedWillResultInFalse()
testMigrationTaskIsAlreadyFinishedResultInFalse()