36 function ReportCachePurgeAll()
44 const PERCENTAGE = 315;
46 private $uploadTreeId;
52 private $agentLicenseEventProcessor;
58 private $itemTreeBounds;
60 private $clearingDecisionProcessor;
62 private $clearingEventProcessor;
66 private $includeSubFolders;
68 protected function setUp()
70 $this->uploadTreeId = 432;
74 $this->timestamp = time();
75 $this->includeSubFolders =
false;
77 $this->clearingDao = M::mock(ClearingDao::class);
78 $this->agentLicenseEventProcessor = M::mock(AgentLicenseEventProcessor::class);
81 $this->itemTreeBounds = M::mock(ItemTreeBounds::class);
82 $this->itemTreeBounds->shouldReceive(
"getItemId")->withNoArgs()->andReturn($this->uploadTreeId);
83 $this->itemTreeBounds->shouldReceive(
"getPfileId")->withNoArgs()->andReturn($this->pfileId);
85 $this->
dbManager = M::mock(DbManager::class);
86 $this->
dbManager->shouldReceive(
'begin')->withNoArgs();
87 $this->
dbManager->shouldReceive(
'commit')->withNoArgs();
90 $this->clearingDao, $this->agentLicenseEventProcessor, $this->clearingEventProcessor,
92 $this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
95 protected function tearDown()
97 $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
101 public function testMakeDecisionFromLastEvents()
103 $isGlobal = DecisionScopes::REPO;
106 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
107 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
108 ->andReturn(array($addedEvent));
109 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
110 ->with($this->itemTreeBounds)
111 ->andReturn(array());
113 $clearingDecision = M::mock(ClearingDecision::class);
114 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
115 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IDENTIFIED);
116 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
118 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
119 ->with($this->itemTreeBounds, $this->groupId)
120 ->andReturn($clearingDecision);
122 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->once()
123 ->with($this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, $isGlobal, is(arrayContainingInAnyOrder(123)));
125 $this->clearingDecisionProcessor->makeDecisionFromLastEvents($this->itemTreeBounds, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, $isGlobal);
128 public function testMakeDecisionFromLastEventsWithNoLicenseKnownTypeShouldNotCreateANewDecisionWhenNoLicensesShouldBeRemoved()
130 $isGlobal = DecisionScopes::REPO;
133 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
134 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
135 ->andReturn(array($addedEvent));
136 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
137 ->with($this->itemTreeBounds)->andReturn(array());
139 $clearingDecision = M::mock(ClearingDecision::class);
140 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
141 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IDENTIFIED);
142 $clearingDecision->shouldReceive(
"getScope")->withNoArgs()->andReturn(DecisionScopes::ITEM);
143 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
145 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
146 ->with($this->itemTreeBounds, $this->groupId)
147 ->andReturn($clearingDecision);
149 $this->clearingDao->shouldReceive(
"insertClearingEvent")->with($this->itemTreeBounds->getItemId(), $this->userId, $this->groupId, $addedEvent->getLicenseId(),
true)->andReturn($eventId);
151 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->once()->with($this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, $isGlobal, array($eventId));
152 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
157 public function testMakeDecisionFromLastEventsWithNoLicenseKnownTypeShouldNotCreateANewDecisionWhenNoLicensesShouldBeRemovedAndTheScopeDoesNotChange()
159 $isGlobal = DecisionScopes::REPO;
162 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
163 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
164 ->andReturn(array($addedEvent));
165 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
166 ->with($this->itemTreeBounds)->andReturn(array());
168 $clearingDecision = M::mock(ClearingDecision::class);
169 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
170 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IDENTIFIED);
171 $clearingDecision->shouldReceive(
"getScope")->withNoArgs()->andReturn($isGlobal);
172 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
174 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
175 ->with($this->itemTreeBounds, $this->groupId)
176 ->andReturn($clearingDecision);
179 $this->clearingDao->shouldReceive(
"insertClearingEvent")->with($this->itemTreeBounds->getItemId(), $this->userId, $this->groupId, $addedEvent->getLicenseId(),
true)->andReturn($eventId);
180 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->once()->with($this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, $isGlobal, array($eventId));
181 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
186 public function testMakeDecisionFromLastEventsWithNoLicenseKnownType()
190 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
191 ->with($this->itemTreeBounds)->andReturn(array());
193 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
194 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
195 ->andReturn(array());
197 $clearingDecision = M::mock(ClearingDecision::class);
198 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
199 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IRRELEVANT);
200 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
202 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
203 ->with($this->itemTreeBounds, $this->groupId)
204 ->andReturn($clearingDecision);
206 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->once()->with( $this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, DecisionScopes::REPO, array());
207 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
212 public function testMakeDecisionFromLastEventsWithNoLicenseKnownTypeAndAnExistingAddingUserEvent()
216 $addedEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseRef->getId(), $licenseRef->getShortName(), $licenseRef->getFullName(), ClearingEventTypes::USER, $isRemoved =
false);
220 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
221 ->with($this->itemTreeBounds)->andReturn(array());
223 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
224 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
225 ->andReturn(array($licenseRef->getId() => $addedEvent));
227 $clearingDecision = M::mock(ClearingDecision::class);
228 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
229 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IRRELEVANT);
230 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
232 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
233 ->with($this->itemTreeBounds, $this->groupId)
234 ->andReturn($clearingDecision);
237 $this->clearingDao->shouldReceive(
"insertClearingEvent")->with($this->itemTreeBounds->getItemId(), $this->userId, $this->groupId, $addedEvent->getLicenseId(),
true)->andReturn($eventId);
238 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->once()->with( $this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, DecisionScopes::REPO, array($eventId));
239 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
244 public function testMakeDecisionFromLastEventsWithNoLicenseKnownTypeAndAnExistingRemovingUserEvent()
248 $removedEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseRef->getId(), $licenseRef->getShortName(), $licenseRef->getFullName(), ClearingEventTypes::USER, $isRemoved =
true);
252 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
253 ->with($this->itemTreeBounds)->andReturn(array());
255 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
256 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
257 ->andReturn(array($licenseRef->getId() => $removedEvent));
259 $clearingDecision = M::mock(ClearingDecision::class);
260 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
261 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IRRELEVANT);
262 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
264 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
265 ->with($this->itemTreeBounds, $this->groupId)
266 ->andReturn($clearingDecision);
268 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->once()->with( $this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, DecisionScopes::REPO, array());
269 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
276 public function testMakeDecisionFromLastEventsWithDelayedScanner()
282 $removedEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseRef->getId(), $licenseRef->getShortName(), $licenseRef->getFullName(), ClearingEventTypes::USER, $isRemoved =
true);
284 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
285 ->with($this->itemTreeBounds, $this->groupId, $this->includeSubFolders)
286 ->andReturn(array($licenseRef->getId() => $removedEvent));
288 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
289 ->with($this->itemTreeBounds)->andReturn($scannerResults);
291 $clearingDecision = M::mock(ClearingDecision::class);
292 $clearingDecision->shouldReceive(
"getTimeStamp")->withNoArgs()->andReturn($this->timestamp-3600);
293 $clearingDecision->shouldReceive(
"getType")->withNoArgs()->andReturn(DecisionTypes::IDENTIFIED);
294 $clearingDecision->shouldReceive(
"getClearingEvents")->withNoArgs()->andReturn(array());
296 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")
297 ->with($this->itemTreeBounds,$this->groupId)
298 ->andReturn($clearingDecision);
300 $this->clearingDao->shouldReceive(
"insertClearingEvent")
303 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")
305 ->with($this->uploadTreeId, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, DecisionScopes::ITEM,
306 is(arrayContainingInAnyOrder($removedEvent->getEventId())));
307 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
309 $this->clearingDecisionProcessor->makeDecisionFromLastEvents($this->itemTreeBounds, $this->userId, $this->groupId, DecisionTypes::IDENTIFIED, $isGlobal);
312 public function testMakeDecisionFromLastEventsWithInvalidType()
314 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")->never();
315 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerDetectedLicenses")->never();
316 $this->clearingDao->shouldReceive(
"getRelevantClearingDecision")->never();
318 $this->clearingDao->shouldReceive(
"createDecisionFromEvents")->never();
319 $this->clearingDao->shouldReceive(
"removeWipClearingDecision")->never();
324 public function testGetCurrentClearingsWithoutDecisions()
326 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
327 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)
328 ->andReturn(array());
329 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")->with($this->itemTreeBounds, $this->groupId)->andReturn(array());
331 list($licenseDecisions, $removedClearings) = $this->clearingDecisionProcessor->getCurrentClearings($this->itemTreeBounds, $this->groupId);
333 assertThat($licenseDecisions, is(emptyArray()));
334 assertThat($removedClearings, is(emptyArray()));
337 public function testGetCurrentClearingsWithUserDecisionsOnly()
339 $addedEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseId=13,
"licA",
"License A");
341 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
342 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)
343 ->andReturn(array());
344 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
345 ->with($this->itemTreeBounds, $this->groupId)
346 ->andReturn(array($licenseId => $addedEvent));
348 list($licenseDecisions, $removedClearings) = $this->clearingDecisionProcessor->getCurrentClearings($this->itemTreeBounds, $this->groupId);
350 assertThat($licenseDecisions, is(arrayWithSize(1)));
353 $result = $licenseDecisions[$addedEvent->getLicenseId()];
354 assertThat($result->getLicenseRef(), is($addedEvent->getLicenseRef()));
355 assertThat($result->getClearingEvent(), is($addedEvent));
356 assertThat($result->getAgentDecisionEvents(), is(emptyArray()));
357 assertThat($removedClearings, is(emptyArray()));
360 public function testGetCurrentClearingsWithAgentDecisionsOnly()
364 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
365 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)
366 ->andReturn($scannerResults);
367 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
368 ->with($this->itemTreeBounds, $this->groupId)
369 ->andReturn(array());
371 list($licenseDecisions, $removedClearings) = $this->clearingDecisionProcessor->getCurrentClearings($this->itemTreeBounds, $this->groupId);
373 assertThat($licenseDecisions, is(arrayWithSize(1)));
376 $result = $licenseDecisions[$licenseRef->getId()];
377 assertThat($result->getLicenseRef(), is($licenseRef));
378 assertThat($result->getClearingEvent(), is(nullValue()));
379 assertThat($result->getAgentDecisionEvents(), is(arrayWithSize(1)));
380 assertThat($removedClearings, is(emptyArray()));
383 public function testGetCurrentClearingsWithUserAndAgentDecision()
388 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
389 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)
390 ->andReturn($scannerResults);
392 $licenseId = $licenseRef->getId();
394 $addedEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseId, $licenseRef->getShortName(), $licenseRef->getFullName());
395 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
396 ->with($this->itemTreeBounds, $this->groupId)
397 ->andReturn(array($licenseId => $addedEvent));
399 list($licenseDecisions, $removedClearings) = $this->clearingDecisionProcessor->getCurrentClearings($this->itemTreeBounds, $this->groupId);
401 assertThat($licenseDecisions, is(arrayWithSize(1)));
404 $result = $licenseDecisions[$licenseRef->getId()];
405 assertThat($result->getLicenseRef(), is($licenseRef));
406 assertThat($result->getClearingEvent(), is($addedEvent));
407 assertThat($result->getAgentDecisionEvents(), is(arrayWithSize(1)));
408 assertThat($removedClearings, is(emptyArray()));
411 public function testGetCurrentClearingsWithUserRemovedDecisionsOnly()
415 $removedEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseRef->getId(), $licenseRef->getShortName(), $licenseRef->getFullName(), ClearingEventTypes::USER,
true);
417 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
418 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)->andReturn($scannerResults);
420 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
421 ->with($this->itemTreeBounds, $this->groupId)
422 ->andReturn(array($licenseRef->getId() => $removedEvent));
424 list($licenseDecisions, $removedClearings) = $this->clearingDecisionProcessor->getCurrentClearings($this->itemTreeBounds, $this->groupId);
426 assertThat($licenseDecisions, is(emptyArray()));
427 assertThat($removedClearings, is(arrayWithSize(1)));
430 $result = $removedClearings[$removedEvent->getLicenseId()];
431 assertThat($result->getLicenseRef(), is($removedEvent->getLicenseRef()));
432 assertThat($result->getClearingEvent(), is($removedEvent));
433 $agentClearingEvents = $result->getAgentDecisionEvents();
434 assertThat($agentClearingEvents, is(arrayWithSize(1)));
436 $agentEvent = $agentClearingEvents[0];
438 assertThat($agentEvent->getAgentRef(), is($agentRef));
439 assertThat($agentEvent->getLicenseRef(), is($licenseRef));
440 assertThat($agentEvent->getMatchId(), is(self::MATCH_ID));
441 assertThat($agentEvent->getPercentage(), is(self::PERCENTAGE));
444 public function testGetUnhandledScannerDetectedLicenses()
449 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
450 ->with($this->itemTreeBounds, $this->groupId)
451 ->andReturn(array());
452 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
453 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)->andReturn($scannerResults);
455 $hasUnhandledScannerDetectedLicenses = $this->clearingDecisionProcessor->hasUnhandledScannerDetectedLicenses($this->itemTreeBounds, $this->groupId);
457 assertThat($hasUnhandledScannerDetectedLicenses);
460 public function testGetUnhandledScannerDetectedLicensesWithMatch()
464 $clearingEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseRef->getId(), $licenseRef->getShortName(), $licenseRef->getFullName());
466 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")->once()
467 ->with($this->itemTreeBounds, $this->groupId)
468 ->andReturn(array($clearingEvent->getLicenseId()=>$clearingEvent));
469 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")->once()
470 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)->andReturn($scannerResults);
472 $hasUnhandledScannerDetectedLicenses = $this->clearingDecisionProcessor->hasUnhandledScannerDetectedLicenses($this->itemTreeBounds, $this->groupId);
474 assertThat( $hasUnhandledScannerDetectedLicenses, is(False));
477 public function testGetUnhandledScannerDetectedLicensesWithoutMatch()
482 $clearingEvent = $this->
createClearingEvent(123, $this->timestamp, $licenseRef->getId()+$offset, $licenseRef->getShortName(), $licenseRef->getFullName());
484 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
485 ->with($this->itemTreeBounds, $this->groupId)
486 ->andReturn(array($clearingEvent->getLicenseId()=>$clearingEvent));
487 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
488 ->with($this->itemTreeBounds,LicenseMap::TRIVIAL)->andReturn($scannerResults);
490 $hasUnhandledScannerDetectedLicenses = $this->clearingDecisionProcessor->hasUnhandledScannerDetectedLicenses($this->itemTreeBounds, $this->groupId);
492 assertThat($hasUnhandledScannerDetectedLicenses, is(True));
495 public function testGetUnhandledScannerDetectedLicensesWithMappedMatch()
500 $clearingEvent = $this->
createClearingEvent($eventId=123, $this->timestamp, $licenseRef->getId()+$offset, $licenseRef->getShortName(), $licenseRef->getFullName());
502 $this->clearingDao->shouldReceive(
"getRelevantClearingEvents")
503 ->with($this->itemTreeBounds, $this->groupId)
504 ->andReturn(array($clearingEvent->getLicenseId()=>$clearingEvent));
505 $this->agentLicenseEventProcessor->shouldReceive(
"getScannerEvents")
506 ->with($this->itemTreeBounds,LicenseMap::CONCLUSION)->andReturn($scannerResults);
508 $licenseMap = M::mock(LicenseMap::class);
509 $licenseMap->shouldReceive(
'getProjectedId')->andReturnUsing(
function($id) {
512 $licenseMap->shouldReceive(
'getUsage')->andReturn(LicenseMap::CONCLUSION);
514 $hasUnhandledScannerDetectedLicenses = $this->clearingDecisionProcessor->hasUnhandledScannerDetectedLicenses($this->itemTreeBounds, $this->groupId, array(), $licenseMap);
516 assertThat( $hasUnhandledScannerDetectedLicenses, is(False) );
531 private function createClearingEvent($eventId, $timestamp, $licenseId, $licenseShortName, $licenseFullName, $eventType = ClearingEventTypes::USER, $isRemoved =
false, $reportInfo =
"<reportInfo>", $comment =
"<comment>")
533 $licenseRef =
new LicenseRef($licenseId, $licenseShortName, $licenseFullName);
534 $clearingLicense =
new ClearingLicense($licenseRef, $isRemoved, $reportInfo, $comment);
535 return new ClearingEvent($eventId, $this->uploadTreeId, $timestamp, $this->userId, $this->groupId, $eventType, $clearingLicense);
543 $licenseRef =
new LicenseRef($licenseId, $licenseShortname, $licenseFullName);
545 $agentRef = M::mock(AgentRef::class);
547 $scannerEvents = array(
548 $licenseId => array(
new AgentClearingEvent($licenseRef, $agentRef, self::MATCH_ID, self::PERCENTAGE))
551 return array($scannerEvents, $licenseRef, $agentRef);
createScannerDetectedLicenses($licenseId=13, $licenseShortname="licA", $licenseFullName="License-A")
Utility functions to process ClearingDecision.
Functions to process clearing events.
Contains business rules for FOSSology.
fo_dbManager * dbManager
fo_dbManager object
createClearingEvent($eventId, $timestamp, $licenseId, $licenseShortName, $licenseFullName, $eventType=ClearingEventTypes::USER, $isRemoved=false, $reportInfo="<reportInfo>", $comment="<comment>")
const NO_LICENSE_KNOWN_DECISION_TYPE