9 namespace Fossology\Lib\Dao;
20 use Monolog\Handler\ErrorLogHandler;
22 use Mockery\MockInterface;
38 private $groupId = 601;
41 protected function setUp() :
void
43 $this->uploadDao = M::mock(UploadDao::class);
44 $this->uploadDao->shouldReceive(
'getUploadEntry')->withAnyArgs()->andReturn([
"upload_fk" => 4]);
46 $logger =
new Logger(
'default');
47 $logger->pushHandler(
new ErrorLogHandler());
50 $this->
dbManager = &$this->testDb->getDbManager();
54 $this->testDb->createPlainTables(
57 'clearing_decision_event',
58 'clearing_decision_type',
62 'custom_phrase_license_map',
72 $this->testDb->createInheritedTables();
76 array(
'in_same_group', 2),
77 array(
'in_trusted_group', 3));
78 foreach ($userArray as $ur) {
79 $this->
dbManager->insertInto(
'users',
'user_name, root_folder_fk', $ur);
83 array(401,
'FOO',
'FOO',
'foo full',
'foo text'),
84 array(402,
'BAR',
'BAR',
'bar full',
'bar text'),
85 array(403,
'BAZ',
'BAZ',
'baz full',
'baz text'),
86 array(404,
'QUX',
'QUX',
'qux full',
'qux text')
88 foreach ($refArray as $params) {
89 $this->
dbManager->insertInto(
'license_ref',
'rf_pk, rf_shortname, rf_spdx_id, rf_fullname, rf_text', $params, $logStmt =
'insert.ref');
105 $this->items = array(
106 299=>array(101, 299, 0, $modd, 1, 4,
"upload101"),
107 300=>array(102, 300, 0, $modd, 1, 8,
"upload102"),
108 301=>array(101, 301, 201, $modf, 1, 2,
"Afile"),
109 302=>array(101, 302, 202, $modf, 3, 4,
"Bfile"),
110 303=>array(102, 303, 201, $modf, 1, 2,
"Afile"),
111 304=>array(102, 304, 0, $modd, 3, 6,
"A-dir"),
112 305=>array(102, 305, 201, $modf, 4, 5,
"Afile"),
113 306=>array(102, 306, 202, $modf, 7, 8,
"Bfile"),
115 foreach ($this->items as $ur) {
116 $this->
dbManager->insertInto(
'uploadtree',
'upload_fk,uploadtree_pk,pfile_fk,ufile_mode,lft,rgt,ufile_name', $ur);
120 $bulkLicArray = array(
121 array(1, 401,
'TextFOO',
false, 101, 299, $this->groupId),
122 array(2, 402,
'TextBAR',
false, 101, 299, $this->groupId),
123 array(3, 403,
'TextBAZ',
true, 101, 301, $this->groupId),
124 array(4, 403,
'TextBAZ',
false, 101, 299, $this->groupId),
125 array(5, 404,
'TextQUX',
true, 101, 299, $this->groupId),
126 array(6, 401,
'TexxFOO',
true, 101, 302, $this->groupId),
127 array(7, 403,
'TextBAZ',
false, 102, 300, $this->groupId),
128 array(8, 403,
'TextBAZ',
true, 102, 306, $this->groupId)
130 foreach ($bulkLicArray as $params) {
131 $paramsRef = array($params[0], $params[2], $params[4], $params[5], $params[6]);
132 $paramsSet = array($params[0], $params[1], $params[3]);
133 $this->
dbManager->insertInto(
'license_ref_bulk',
'lrb_pk, rf_text, upload_fk, uploadtree_fk, group_fk', $paramsRef,
'insert.bulkref');
134 $this->
dbManager->insertInto(
'license_set_bulk',
'lrb_fk, rf_fk, removing', $paramsSet,
'insert.bulkset');
139 $kotobaPhrases = array(
140 1 => array(
'TextFOO', array(array(401,
false))),
141 2 => array(
'TextMixed', array(array(401,
false), array(402,
true))),
143 foreach ($kotobaPhrases as $cpPk => $phrase) {
144 list($text, $mappings) = $phrase;
145 $this->
dbManager->insertInto(
'custom_phrase',
'cp_pk, group_fk, text, text_md5, is_active',
146 array($cpPk, $this->groupId, $text, md5(
'phrase' . $cpPk),
true),
'insert.customphrase');
147 foreach ($mappings as $mapping) {
148 list($rfFk, $removing) = $mapping;
149 $this->
dbManager->insertInto(
'custom_phrase_license_map',
'cp_fk, rf_fk, removing',
150 array($cpPk, $rfFk, $removing),
'insert.customphraselicensemap');
154 $this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
157 private function insertBulkEvents()
159 $bulkFindingsArray = array(
167 foreach ($bulkFindingsArray as $params) {
168 $this->
dbManager->insertInto(
'highlight_bulk',
'lrb_fk, clearing_event_fk', $params, $logStmt =
'insert.bulkfinds');
171 $bulkClearingEvents = array(
178 foreach ($bulkClearingEvents as $params) {
179 $this->
dbManager->insertInto(
'clearing_event',
'clearing_event_pk, uploadtree_fk', $params, $logStmt =
'insert.bulkevents');
190 $kotobaClearingEvents = array(
192 array(6001, 302, 1,
true),
193 array(6002, 301, 2,
true),
194 array(6003, 301, 2,
false),
196 foreach ($kotobaClearingEvents as $params) {
197 list($cePk, $uploadtreeFk, $cpFk, $hasHighlight) = $params;
198 $this->
dbManager->insertInto(
'clearing_event',
'clearing_event_pk, uploadtree_fk, type_fk, group_fk',
199 array($cePk, $uploadtreeFk, ClearingEventTypes::KOTOBA, $this->groupId),
'insert.kotobaevents');
201 $this->
dbManager->insertInto(
'highlight_kotoba',
'clearing_event_fk, cp_fk',
202 array($cePk, $cpFk),
'insert.kotobafinds');
207 private function buildProposals($licProp,$i=0)
209 foreach ($licProp as $lp) {
210 list($item,$user,$group,$rf,$isRm,$t) = $lp;
211 $this->
dbManager->insertInto(
'clearing_event',
212 'clearing_event_pk, uploadtree_fk, user_fk, group_fk, rf_fk, removed, type_fk, date_added',
213 array($i,$item,$user,$group,$rf,$isRm,1, $this->getMyDate($this->now+$t)));
218 private function buildDecisions($cDec,$j=0)
220 foreach ($cDec as $cd) {
221 list($item,$user,$group,$type,$t,$scope,$eventIds) = $cd;
222 $this->
dbManager->insertInto(
'clearing_decision',
223 'clearing_decision_pk, uploadtree_fk, pfile_fk, user_fk, group_fk, decision_type, date_added, scope',
224 array($j,$item,$this->items[$item][2],$user,$group,$type, $this->getMyDate($this->now+$t),$scope));
225 foreach ($eventIds as $eId) {
226 $this->
dbManager->insertTableRow(
'clearing_decision_event', array(
'clearing_decision_fk' => $j,
'clearing_event_fk' => $eId));
232 function tearDown() : void
234 $this->testDb =
null;
236 $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
239 private function getMyDate($ts)
241 return date(
'Y-m-d H:i:s T',$ts);
244 public function testRelevantClearingEvents()
247 $this->buildProposals(array(
248 array(301,1,$groupId,401,
false,-99),
249 array(301,2,$groupId,402,
true,-98),
250 array(301,2,$groupId,401,
true,-97)
252 $this->buildDecisions(array(
253 array(301,1,$groupId,DecisionTypes::IDENTIFIED,-90,DecisionScopes::REPO,array($firstEventId,$firstEventId+1,$firstEventId+2))
255 $itemTreeBounds = M::mock(ItemTreeBounds::class);
256 $itemTreeBounds->shouldReceive(
'getItemId')->andReturn(301);
257 $itemTreeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
'uploadtree');
258 $itemTreeBounds->shouldReceive(
'containsFiles')->andReturn(
false);
259 $itemTreeBounds->shouldReceive(
'getUploadId')->andReturn($this->items[301][0]);
260 $itemTreeBounds->shouldReceive(
'getLeft')->andReturn($this->items[301][4]);
261 $itemTreeBounds->shouldReceive(
'getRight')->andReturn($this->items[301][5]);
262 $this->uploadDao->shouldReceive(
'getGlobalDecisionSettingsFromInfo')
263 ->withArgs([$this->items[301][0]])->andReturn(
false);
265 $events1 = $this->clearingDao->getRelevantClearingEvents($itemTreeBounds, $groupId);
267 assertThat($events1, arrayWithSize(2));
268 assertThat($events1, hasKeyInArray(401));
269 assertThat($events1, hasKeyInArray(402));
270 assertThat($events1[401], is(anInstanceOf(ClearingEvent::class)));
271 assertThat($events1[402]->getEventId(), is($firstEventId+1));
272 assertThat($events1[401]->getEventId(), is($firstEventId+2));
278 $this->buildProposals(array(
279 array(301,1,$groupId,401,
false,-99),
280 array(301,1,$groupId,402,
false,-98),
281 array(301,1,$groupId,401,
true,-89),
283 $this->buildDecisions(array(
284 array(301,1,$groupId,DecisionTypes::IDENTIFIED,-90,DecisionScopes::REPO,array($firstEventId,$firstEventId+1))
286 $watchThis = $this->clearingDao->isDecisionCheck(301, $groupId, DecisionTypes::WIP);
287 assertThat($watchThis,is(FALSE));
288 $watchOther = $this->clearingDao->isDecisionCheck(303, $groupId, DecisionTypes::WIP);
289 assertThat($watchOther,is(FALSE));
290 $this->buildProposals(array(
291 array(301,1,$groupId,403,
false,-89),
293 $this->clearingDao->markDecisionAsWip(301, 1, $groupId);
294 $watchThisNow = $this->clearingDao->isDecisionCheck(301, $groupId, DecisionTypes::WIP);
295 assertThat($watchThisNow,is(TRUE));
296 $watchOtherNow = $this->clearingDao->isDecisionCheck(303, $groupId, DecisionTypes::WIP);
297 assertThat($watchOtherNow,is(FALSE));
300 private function collectBulkLicenses($bulks)
303 foreach ($bulks as $bulk) {
304 if (array_key_exists(
'removedLicenses', $bulk)) {
305 $bulkLics = array_merge($bulkLics, $bulk[
'removedLicenses']);
307 if (array_key_exists(
'addedLicenses', $bulk)) {
308 $bulkLics = array_merge($bulkLics, $bulk[
'addedLicenses']);
314 public function testBulkHistoryWithoutMatches()
316 $treeBounds = M::mock(ItemTreeBounds::class);
317 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
318 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
319 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
320 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
321 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId);
323 $bulkMatched = array_map(
function($bulk){
324 return $bulk[
'matched'];
326 $bulkText = array_map(
function($bulk){
327 return $bulk[
'text'];
330 assertThat($bulkMatched, arrayContaining(
false,
false,
false,
false,
false));
331 assertThat($this->collectBulkLicenses($bulks), arrayContaining(
'FOO',
'BAR',
'BAZ',
'BAZ',
'QUX'));
332 assertThat($bulkText, arrayContaining(
'TextFOO',
'TextBAR',
'TextBAZ',
'TextBAZ',
'TextQUX'));
335 public function testBulkHistoryWithoutMatchesFromDifferentFolder()
337 $treeBounds = M::mock(ItemTreeBounds::class);
338 $treeBounds->shouldReceive(
'getItemId')->andReturn(305);
339 $treeBounds->shouldReceive(
'getLeft')->andReturn(4);
340 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
341 $treeBounds->shouldReceive(
'getUploadId')->andReturn(102);
342 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId);
344 $bulkMatched = array_map(
function($bulk){
345 return $bulk[
'matched'];
347 assertThat($bulkMatched, arrayContaining(
false));
350 public function testBulkHistoryWithAMatch()
352 $this->insertBulkEvents();
354 $treeBounds = M::mock(ItemTreeBounds::class);
355 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
356 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
357 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
358 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
359 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId);
361 $clearingEventIds = array_map(
function($bulk){
364 $bulkMatched = array_map(
function($bulk){
365 return $bulk[
'matched'];
367 $bulkLicDirs = array_map(
function($bulk){
368 return count($bulk[
'removedLicenses'])>0;
370 $bulkTried = array_map(
function($bulk){
371 return $bulk[
'tried'];
374 assertThat($clearingEventIds, arrayContaining(5001,
null,
null, 5004,
null));
375 assertThat($bulkMatched, arrayContaining(
true,
false,
false,
true,
false));
376 assertThat($this->collectBulkLicenses($bulks), arrayContaining(
'FOO',
'BAR',
'BAZ',
'BAZ',
'QUX'));
377 assertThat($bulkLicDirs, arrayContaining(
false,
false,
true,
false,
true));
378 assertThat($bulkTried, arrayContaining(
true,
true,
true,
true,
true));
381 public function testBulkHistoryWithAMatchReturningAlsoNotTried()
383 $this->insertBulkEvents();
385 $treeBounds = M::mock(ItemTreeBounds::class);
386 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
387 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
388 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
389 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
390 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId,
false);
392 $clearingEventIds = array_map(
function($bulk){
395 $bulkMatched = array_map(
function($bulk){
396 return $bulk[
'matched'];
398 $bulkLicDirs = array_map(
function($bulk){
399 return count($bulk[
'removedLicenses'])>0;
401 $bulkTried = array_map(
function($bulk){
402 return $bulk[
'tried'];
405 assertThat($clearingEventIds, arrayContaining(5001,
null,
null, 5004,
null,
null));
406 assertThat($bulkMatched, arrayContaining(
true,
false,
false,
true,
false,
false));
407 assertThat($this->collectBulkLicenses($bulks), arrayContaining(
'FOO',
'BAR',
'BAZ',
'BAZ',
'QUX',
'FOO'));
408 assertThat($bulkLicDirs, arrayContaining(
false,
false,
true,
false,
true,
true));
409 assertThat($bulkTried, arrayContaining(
true,
true,
true,
true,
true,
false));
424 $treeBounds = M::mock(ItemTreeBounds::class);
425 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
426 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
427 $treeBounds->shouldReceive(
'getRight')->andReturn(2);
428 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
429 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
430 $phrases = $this->clearingDao->getKotobaHistory($treeBounds, $this->groupId);
432 assertThat($phrases, hasKeyInArray(2));
433 $mixedPhrase = $phrases[2];
434 assertThat($mixedPhrase[
'text'], is(
'TextMixed'));
435 assertThat($mixedPhrase[
'matched'], is(
true));
436 assertThat($mixedPhrase[
'tried'], is(
true));
437 assertThat($mixedPhrase[
'addedLicenses'], arrayContaining(
'FOO'));
438 assertThat($mixedPhrase[
'removedLicenses'], arrayContaining(
'BAR'));
453 $fileBounds = M::mock(ItemTreeBounds::class);
454 $fileBounds->shouldReceive(
'getItemId')->andReturn(301);
455 $fileBounds->shouldReceive(
'getLeft')->andReturn(1);
456 $fileBounds->shouldReceive(
'getRight')->andReturn(2);
457 $fileBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
458 $fileBounds->shouldReceive(
'getUploadId')->andReturn(101);
459 $phrasesFromFile = $this->clearingDao->getKotobaHistory($fileBounds, $this->groupId);
460 assertThat($phrasesFromFile, is(not(hasKeyInArray(1))));
464 $rootBounds = M::mock(ItemTreeBounds::class);
465 $rootBounds->shouldReceive(
'getItemId')->andReturn(299);
466 $rootBounds->shouldReceive(
'getLeft')->andReturn(1);
467 $rootBounds->shouldReceive(
'getRight')->andReturn(4);
468 $rootBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
469 $rootBounds->shouldReceive(
'getUploadId')->andReturn(101);
470 $phrasesFromRoot = $this->clearingDao->getKotobaHistory($rootBounds, $this->groupId);
471 assertThat($phrasesFromRoot, hasKeyInArray(1));
472 assertThat($phrasesFromRoot[1][
'matched'], is(
false));
473 assertThat($phrasesFromRoot[1][
'tried'], is(
true));
486 $treeBounds = M::mock(ItemTreeBounds::class);
487 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
488 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
489 $treeBounds->shouldReceive(
'getRight')->andReturn(2);
490 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
491 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
492 $phrases = $this->clearingDao->getKotobaHistory($treeBounds, $this->groupId);
494 assertThat($phrases, is(emptyArray()));
497 public function testGetClearedLicenseMultiplicities()
504 $this->buildProposals(array(array(303,$user,$groupId,$rf,$isRm,$t),
505 array(305,$user,$groupId,$rf,$isRm,$t+1)),$eventId=0);
506 $type = DecisionTypes::IDENTIFIED;
507 $scope = DecisionScopes::ITEM;
508 $this->buildDecisions(array(array(303,$user,$groupId,$type,$t,$scope,array($eventId)),
509 array(305,$user,$groupId,$type,$t,$scope,array($eventId+1))));
510 $treeBounds = M::mock(ItemTreeBounds::class);
512 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
513 $treeBounds->shouldReceive(
'getRight')->andReturn(8);
514 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
515 $treeBounds->shouldReceive(
'getUploadId')->andReturn(102);
517 $this->uploadDao->shouldReceive(
'getGlobalDecisionSettingsFromInfo')
518 ->withArgs([102])->andReturn(
false);
520 $map = $this->clearingDao->getClearedLicenseIdAndMultiplicities($treeBounds, $groupId);
521 assertThat($map, is(array(
'FOO'=>array(
'count'=>2,
'shortname'=>
'FOO',
'spdx_id'=>
'FOO',
'rf_pk'=>401))));
524 public function testGetClearedLicenses()
532 $this->buildProposals(array(array($item,$user,$groupId,$rf,$isRm,$t),
533 array($item,$user,$groupId,$rf+1,!$isRm,$t+1)),$eventId=0);
534 $type = DecisionTypes::IDENTIFIED;
535 $scope = DecisionScopes::ITEM;
536 $this->buildDecisions(array( array( $item,$user,$groupId,$type,$t,$scope,array($eventId,$eventId+1) ) ));
537 $treeBounds = M::mock(ItemTreeBounds::class);
539 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
540 $treeBounds->shouldReceive(
'getRight')->andReturn(8);
541 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
542 $treeBounds->shouldReceive(
'getUploadId')->andReturn(102);
544 $this->uploadDao->shouldReceive(
'getGlobalDecisionSettingsFromInfo')
545 ->withArgs([102])->andReturn(
false);
547 $map = $this->clearingDao->getClearedLicenses($treeBounds, $groupId);
548 assertThat($map, equalTo(array(
new LicenseRef($rf,
'FOO',
'foo full',
'FOO'))));
552 public function testMainLicenseIds()
554 $this->testDb->createPlainTables(array(
'upload_clearing_license'));
556 $mainLicIdsInitially = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
557 assertThat($mainLicIdsInitially, is(emptyArray()));
559 $this->clearingDao->makeMainLicense($uploadId,$this->groupId,$licenseId=402);
560 $mainLicIdsAfterAddingOne = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
561 assertThat($mainLicIdsAfterAddingOne, arrayContaining(array($licenseId)));
563 $this->clearingDao->makeMainLicense($uploadId,$this->groupId,$licenseId);
564 $mainLicIdsAfterAddingOneTwice = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
565 assertThat($mainLicIdsAfterAddingOneTwice, is(arrayWithSize(1)));
567 $this->clearingDao->makeMainLicense($uploadId,$this->groupId,$licenseId2=403);
568 $mainLicIdsAfterAddingOther = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
569 assertThat($mainLicIdsAfterAddingOther, arrayContainingInAnyOrder(array($licenseId,$licenseId2)));
571 $this->clearingDao->removeMainLicense($uploadId,$this->groupId,$licenseId2);
572 $mainLicIdsAfterRemovingOne = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
573 assertThat($mainLicIdsAfterRemovingOne, is(arrayWithSize(1)));
575 $this->clearingDao->removeMainLicense($uploadId,$this->groupId,$licenseId2);
576 $mainLicIdAfterRemovingSomethingNotInSet = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
577 assertThat($mainLicIdAfterRemovingSomethingNotInSet, is(arrayWithSize(1)));
579 $this->clearingDao->removeMainLicense($uploadId,$this->groupId+1,$licenseId);
580 $mainLicIdAfterInsertToOtherGroup = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
581 assertThat($mainLicIdAfterInsertToOtherGroup, is(arrayWithSize(1)));
583 $this->clearingDao->removeMainLicense($uploadId+1,$this->groupId,$licenseId);
584 $mainLicIdAfterInsertToOtherUpload = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
585 assertThat($mainLicIdAfterInsertToOtherUpload, is(arrayWithSize(1)));
588 public function testupdateClearingEvent()
590 $this->testDb->createSequences(array(
'clearing_event_clearing_event_pk_seq'));
591 $this->testDb->createConstraints(array(
'clearing_event_pkey'));
592 $this->
dbManager->queryOnce(
"ALTER TABLE clearing_event ALTER COLUMN clearing_event_pk SET DEFAULT nextval('clearing_event_clearing_event_pk_seq'::regclass)");
594 $this->clearingDao->updateClearingEvent($uploadTreeId=301, $userId=1, $groupId=1, $licenseId=402, $what=
'comment', $changeCom=
'abc123');
595 $rowPast = $this->
dbManager->getSingleRow(
'SELECT * FROM clearing_event WHERE uploadtree_fk=$1 AND rf_fk=$2 ORDER BY clearing_event_pk DESC LIMIT 1',array($uploadTreeId,$licenseId),__METHOD__.
'beforeReportinfo');
596 assertThat($rowPast[
'comment'],equalTo($changeCom));
598 $this->clearingDao->updateClearingEvent($uploadTreeId, $userId, $groupId, $licenseId, $what=
'reportinfo', $changeRep=
'def456');
599 $rowFuture = $this->
dbManager->getSingleRow(
'SELECT * FROM clearing_event WHERE uploadtree_fk=$1 AND rf_fk=$2 ORDER BY clearing_event_pk DESC LIMIT 1',array($uploadTreeId,$licenseId),__METHOD__.
'afterReportinfo');
600 assertThat($rowFuture[
'comment'],equalTo($changeCom));
601 assertThat($rowFuture[
'reportinfo'],equalTo($changeRep));
testKotobaHistoryDistinguishesMatchedFromTriedOnly()
testKotobaHistoryGroupsAddedAndRemovedLicensesOfSamePhrase()
testKotobaHistoryEmptyWhenNoDecisionsRecordedYet()
fo_dbManager * dbManager
fo_dbManager object