9 namespace Fossology\Lib\Dao;
20 use Monolog\Handler\ErrorLogHandler;
22 use Mockery\MockInterface;
26 public $assertCountBefore;
40 private $groupId = 601;
43 protected function setUp() :
void
45 $this->uploadDao = M::mock(UploadDao::class);
46 $this->uploadDao->shouldReceive(
'getUploadEntry')->withAnyArgs()->andReturn([
"upload_fk" => 4]);
48 $logger =
new Logger(
'default');
49 $logger->pushHandler(
new ErrorLogHandler());
52 $this->
dbManager = &$this->testDb->getDbManager();
56 $this->testDb->createPlainTables(
59 'clearing_decision_event',
60 'clearing_decision_type',
64 'custom_phrase_license_map',
74 $this->testDb->createInheritedTables();
78 array(
'in_same_group', 2),
79 array(
'in_trusted_group', 3));
80 foreach ($userArray as $ur) {
81 $this->
dbManager->insertInto(
'users',
'user_name, root_folder_fk', $ur);
85 array(401,
'FOO',
'FOO',
'foo full',
'foo text'),
86 array(402,
'BAR',
'BAR',
'bar full',
'bar text'),
87 array(403,
'BAZ',
'BAZ',
'baz full',
'baz text'),
88 array(404,
'QUX',
'QUX',
'qux full',
'qux text')
90 foreach ($refArray as $params) {
91 $this->
dbManager->insertInto(
'license_ref',
'rf_pk, rf_shortname, rf_spdx_id, rf_fullname, rf_text', $params, $logStmt =
'insert.ref');
107 $this->items = array(
108 299=>array(101, 299, 0, $modd, 1, 4,
"upload101"),
109 300=>array(102, 300, 0, $modd, 1, 8,
"upload102"),
110 301=>array(101, 301, 201, $modf, 1, 2,
"Afile"),
111 302=>array(101, 302, 202, $modf, 3, 4,
"Bfile"),
112 303=>array(102, 303, 201, $modf, 1, 2,
"Afile"),
113 304=>array(102, 304, 0, $modd, 3, 6,
"A-dir"),
114 305=>array(102, 305, 201, $modf, 4, 5,
"Afile"),
115 306=>array(102, 306, 202, $modf, 7, 8,
"Bfile"),
117 foreach ($this->items as $ur) {
118 $this->
dbManager->insertInto(
'uploadtree',
'upload_fk,uploadtree_pk,pfile_fk,ufile_mode,lft,rgt,ufile_name', $ur);
122 $bulkLicArray = array(
123 array(1, 401,
'TextFOO',
false, 101, 299, $this->groupId),
124 array(2, 402,
'TextBAR',
false, 101, 299, $this->groupId),
125 array(3, 403,
'TextBAZ',
true, 101, 301, $this->groupId),
126 array(4, 403,
'TextBAZ',
false, 101, 299, $this->groupId),
127 array(5, 404,
'TextQUX',
true, 101, 299, $this->groupId),
128 array(6, 401,
'TexxFOO',
true, 101, 302, $this->groupId),
129 array(7, 403,
'TextBAZ',
false, 102, 300, $this->groupId),
130 array(8, 403,
'TextBAZ',
true, 102, 306, $this->groupId)
132 foreach ($bulkLicArray as $params) {
133 $paramsRef = array($params[0], $params[2], $params[4], $params[5], $params[6]);
134 $paramsSet = array($params[0], $params[1], $params[3]);
135 $this->
dbManager->insertInto(
'license_ref_bulk',
'lrb_pk, rf_text, upload_fk, uploadtree_fk, group_fk', $paramsRef,
'insert.bulkref');
136 $this->
dbManager->insertInto(
'license_set_bulk',
'lrb_fk, rf_fk, removing', $paramsSet,
'insert.bulkset');
141 $kotobaPhrases = array(
142 1 => array(
'TextFOO', array(array(401,
false))),
143 2 => array(
'TextMixed', array(array(401,
false), array(402,
true))),
145 foreach ($kotobaPhrases as $cpPk => $phrase) {
146 list($text, $mappings) = $phrase;
147 $this->
dbManager->insertInto(
'custom_phrase',
'cp_pk, group_fk, text, text_md5, is_active',
148 array($cpPk, $this->groupId, $text, md5(
'phrase' . $cpPk),
true),
'insert.customphrase');
149 foreach ($mappings as $mapping) {
150 list($rfFk, $removing) = $mapping;
151 $this->
dbManager->insertInto(
'custom_phrase_license_map',
'cp_fk, rf_fk, removing',
152 array($cpPk, $rfFk, $removing),
'insert.customphraselicensemap');
156 $this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
159 private function insertBulkEvents()
161 $bulkFindingsArray = array(
169 foreach ($bulkFindingsArray as $params) {
170 $this->
dbManager->insertInto(
'highlight_bulk',
'lrb_fk, clearing_event_fk', $params, $logStmt =
'insert.bulkfinds');
173 $bulkClearingEvents = array(
180 foreach ($bulkClearingEvents as $params) {
181 $this->
dbManager->insertInto(
'clearing_event',
'clearing_event_pk, uploadtree_fk', $params, $logStmt =
'insert.bulkevents');
192 $kotobaClearingEvents = array(
194 array(6001, 302, 1,
true),
195 array(6002, 301, 2,
true),
196 array(6003, 301, 2,
false),
198 foreach ($kotobaClearingEvents as $params) {
199 list($cePk, $uploadtreeFk, $cpFk, $hasHighlight) = $params;
200 $this->
dbManager->insertInto(
'clearing_event',
'clearing_event_pk, uploadtree_fk, type_fk, group_fk',
201 array($cePk, $uploadtreeFk, ClearingEventTypes::KOTOBA, $this->groupId),
'insert.kotobaevents');
203 $this->
dbManager->insertInto(
'highlight_kotoba',
'clearing_event_fk, cp_fk',
204 array($cePk, $cpFk),
'insert.kotobafinds');
209 private function buildProposals($licProp,$i=0)
211 foreach ($licProp as $lp) {
212 list($item,$user,$group,$rf,$isRm,$t) = $lp;
213 $this->
dbManager->insertInto(
'clearing_event',
214 'clearing_event_pk, uploadtree_fk, user_fk, group_fk, rf_fk, removed, type_fk, date_added',
215 array($i,$item,$user,$group,$rf,$isRm,1, $this->getMyDate($this->now+$t)));
220 private function buildDecisions($cDec,$j=0)
222 foreach ($cDec as $cd) {
223 list($item,$user,$group,$type,$t,$scope,$eventIds) = $cd;
224 $this->
dbManager->insertInto(
'clearing_decision',
225 'clearing_decision_pk, uploadtree_fk, pfile_fk, user_fk, group_fk, decision_type, date_added, scope',
226 array($j,$item,$this->items[$item][2],$user,$group,$type, $this->getMyDate($this->now+$t),$scope));
227 foreach ($eventIds as $eId) {
228 $this->
dbManager->insertTableRow(
'clearing_decision_event', array(
'clearing_decision_fk' => $j,
'clearing_event_fk' => $eId));
234 function tearDown() : void
236 $this->testDb =
null;
238 $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
241 private function getMyDate($ts)
243 return date(
'Y-m-d H:i:s T',$ts);
246 public function testRelevantClearingEvents()
249 $this->buildProposals(array(
250 array(301,1,$groupId,401,
false,-99),
251 array(301,2,$groupId,402,
true,-98),
252 array(301,2,$groupId,401,
true,-97)
254 $this->buildDecisions(array(
255 array(301,1,$groupId,DecisionTypes::IDENTIFIED,-90,DecisionScopes::REPO,array($firstEventId,$firstEventId+1,$firstEventId+2))
257 $itemTreeBounds = M::mock(ItemTreeBounds::class);
258 $itemTreeBounds->shouldReceive(
'getItemId')->andReturn(301);
259 $itemTreeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
'uploadtree');
260 $itemTreeBounds->shouldReceive(
'containsFiles')->andReturn(
false);
261 $itemTreeBounds->shouldReceive(
'getUploadId')->andReturn($this->items[301][0]);
262 $itemTreeBounds->shouldReceive(
'getLeft')->andReturn($this->items[301][4]);
263 $itemTreeBounds->shouldReceive(
'getRight')->andReturn($this->items[301][5]);
264 $this->uploadDao->shouldReceive(
'getGlobalDecisionSettingsFromInfo')
265 ->withArgs([$this->items[301][0]])->andReturn(
false);
267 $events1 = $this->clearingDao->getRelevantClearingEvents($itemTreeBounds, $groupId);
269 assertThat($events1, arrayWithSize(2));
270 assertThat($events1, hasKeyInArray(401));
271 assertThat($events1, hasKeyInArray(402));
272 assertThat($events1[401], is(anInstanceOf(ClearingEvent::class)));
273 assertThat($events1[402]->getEventId(), is($firstEventId+1));
274 assertThat($events1[401]->getEventId(), is($firstEventId+2));
280 $this->buildProposals(array(
281 array(301,1,$groupId,401,
false,-99),
282 array(301,1,$groupId,402,
false,-98),
283 array(301,1,$groupId,401,
true,-89),
285 $this->buildDecisions(array(
286 array(301,1,$groupId,DecisionTypes::IDENTIFIED,-90,DecisionScopes::REPO,array($firstEventId,$firstEventId+1))
288 $watchThis = $this->clearingDao->isDecisionCheck(301, $groupId, DecisionTypes::WIP);
289 assertThat($watchThis,is(FALSE));
290 $watchOther = $this->clearingDao->isDecisionCheck(303, $groupId, DecisionTypes::WIP);
291 assertThat($watchOther,is(FALSE));
292 $this->buildProposals(array(
293 array(301,1,$groupId,403,
false,-89),
295 $this->clearingDao->markDecisionAsWip(301, 1, $groupId);
296 $watchThisNow = $this->clearingDao->isDecisionCheck(301, $groupId, DecisionTypes::WIP);
297 assertThat($watchThisNow,is(TRUE));
298 $watchOtherNow = $this->clearingDao->isDecisionCheck(303, $groupId, DecisionTypes::WIP);
299 assertThat($watchOtherNow,is(FALSE));
302 private function collectBulkLicenses($bulks)
305 foreach ($bulks as $bulk) {
306 if (array_key_exists(
'removedLicenses', $bulk)) {
307 $bulkLics = array_merge($bulkLics, $bulk[
'removedLicenses']);
309 if (array_key_exists(
'addedLicenses', $bulk)) {
310 $bulkLics = array_merge($bulkLics, $bulk[
'addedLicenses']);
316 public function testBulkHistoryWithoutMatches()
318 $treeBounds = M::mock(ItemTreeBounds::class);
319 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
320 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
321 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
322 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
323 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId);
325 $bulkMatched = array_map(
function($bulk){
326 return $bulk[
'matched'];
328 $bulkText = array_map(
function($bulk){
329 return $bulk[
'text'];
332 assertThat($bulkMatched, arrayContaining(
false,
false,
false,
false,
false));
333 assertThat($this->collectBulkLicenses($bulks), arrayContaining(
'FOO',
'BAR',
'BAZ',
'BAZ',
'QUX'));
334 assertThat($bulkText, arrayContaining(
'TextFOO',
'TextBAR',
'TextBAZ',
'TextBAZ',
'TextQUX'));
337 public function testBulkHistoryWithoutMatchesFromDifferentFolder()
339 $treeBounds = M::mock(ItemTreeBounds::class);
340 $treeBounds->shouldReceive(
'getItemId')->andReturn(305);
341 $treeBounds->shouldReceive(
'getLeft')->andReturn(4);
342 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
343 $treeBounds->shouldReceive(
'getUploadId')->andReturn(102);
344 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId);
346 $bulkMatched = array_map(
function($bulk){
347 return $bulk[
'matched'];
349 assertThat($bulkMatched, arrayContaining(
false));
352 public function testBulkHistoryWithAMatch()
354 $this->insertBulkEvents();
356 $treeBounds = M::mock(ItemTreeBounds::class);
357 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
358 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
359 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
360 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
361 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId);
363 $clearingEventIds = array_map(
function($bulk){
366 $bulkMatched = array_map(
function($bulk){
367 return $bulk[
'matched'];
369 $bulkLicDirs = array_map(
function($bulk){
370 return count($bulk[
'removedLicenses'])>0;
372 $bulkTried = array_map(
function($bulk){
373 return $bulk[
'tried'];
376 assertThat($clearingEventIds, arrayContaining(5001,
null,
null, 5004,
null));
377 assertThat($bulkMatched, arrayContaining(
true,
false,
false,
true,
false));
378 assertThat($this->collectBulkLicenses($bulks), arrayContaining(
'FOO',
'BAR',
'BAZ',
'BAZ',
'QUX'));
379 assertThat($bulkLicDirs, arrayContaining(
false,
false,
true,
false,
true));
380 assertThat($bulkTried, arrayContaining(
true,
true,
true,
true,
true));
383 public function testBulkHistoryWithAMatchReturningAlsoNotTried()
385 $this->insertBulkEvents();
387 $treeBounds = M::mock(ItemTreeBounds::class);
388 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
389 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
390 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
391 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
392 $bulks = $this->clearingDao->getBulkHistory($treeBounds, $this->groupId,
false);
394 $clearingEventIds = array_map(
function($bulk){
397 $bulkMatched = array_map(
function($bulk){
398 return $bulk[
'matched'];
400 $bulkLicDirs = array_map(
function($bulk){
401 return count($bulk[
'removedLicenses'])>0;
403 $bulkTried = array_map(
function($bulk){
404 return $bulk[
'tried'];
407 assertThat($clearingEventIds, arrayContaining(5001,
null,
null, 5004,
null,
null));
408 assertThat($bulkMatched, arrayContaining(
true,
false,
false,
true,
false,
false));
409 assertThat($this->collectBulkLicenses($bulks), arrayContaining(
'FOO',
'BAR',
'BAZ',
'BAZ',
'QUX',
'FOO'));
410 assertThat($bulkLicDirs, arrayContaining(
false,
false,
true,
false,
true,
true));
411 assertThat($bulkTried, arrayContaining(
true,
true,
true,
true,
true,
false));
426 $treeBounds = M::mock(ItemTreeBounds::class);
427 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
428 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
429 $treeBounds->shouldReceive(
'getRight')->andReturn(2);
430 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
431 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
432 $phrases = $this->clearingDao->getKotobaHistory($treeBounds, $this->groupId);
434 assertThat($phrases, hasKeyInArray(2));
435 $mixedPhrase = $phrases[2];
436 assertThat($mixedPhrase[
'text'], is(
'TextMixed'));
437 assertThat($mixedPhrase[
'matched'], is(
true));
438 assertThat($mixedPhrase[
'tried'], is(
true));
439 assertThat($mixedPhrase[
'addedLicenses'], arrayContaining(
'FOO'));
440 assertThat($mixedPhrase[
'removedLicenses'], arrayContaining(
'BAR'));
455 $fileBounds = M::mock(ItemTreeBounds::class);
456 $fileBounds->shouldReceive(
'getItemId')->andReturn(301);
457 $fileBounds->shouldReceive(
'getLeft')->andReturn(1);
458 $fileBounds->shouldReceive(
'getRight')->andReturn(2);
459 $fileBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
460 $fileBounds->shouldReceive(
'getUploadId')->andReturn(101);
461 $phrasesFromFile = $this->clearingDao->getKotobaHistory($fileBounds, $this->groupId);
462 assertThat($phrasesFromFile, is(not(hasKeyInArray(1))));
466 $rootBounds = M::mock(ItemTreeBounds::class);
467 $rootBounds->shouldReceive(
'getItemId')->andReturn(299);
468 $rootBounds->shouldReceive(
'getLeft')->andReturn(1);
469 $rootBounds->shouldReceive(
'getRight')->andReturn(4);
470 $rootBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
471 $rootBounds->shouldReceive(
'getUploadId')->andReturn(101);
472 $phrasesFromRoot = $this->clearingDao->getKotobaHistory($rootBounds, $this->groupId);
473 assertThat($phrasesFromRoot, hasKeyInArray(1));
474 assertThat($phrasesFromRoot[1][
'matched'], is(
false));
475 assertThat($phrasesFromRoot[1][
'tried'], is(
true));
488 $treeBounds = M::mock(ItemTreeBounds::class);
489 $treeBounds->shouldReceive(
'getItemId')->andReturn(301);
490 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
491 $treeBounds->shouldReceive(
'getRight')->andReturn(2);
492 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
493 $treeBounds->shouldReceive(
'getUploadId')->andReturn(101);
494 $phrases = $this->clearingDao->getKotobaHistory($treeBounds, $this->groupId);
496 assertThat($phrases, is(emptyArray()));
499 public function testGetClearedLicenseMultiplicities()
506 $this->buildProposals(array(array(303,$user,$groupId,$rf,$isRm,$t),
507 array(305,$user,$groupId,$rf,$isRm,$t+1)),$eventId=0);
508 $type = DecisionTypes::IDENTIFIED;
509 $scope = DecisionScopes::ITEM;
510 $this->buildDecisions(array(array(303,$user,$groupId,$type,$t,$scope,array($eventId)),
511 array(305,$user,$groupId,$type,$t,$scope,array($eventId+1))));
512 $treeBounds = M::mock(ItemTreeBounds::class);
514 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
515 $treeBounds->shouldReceive(
'getRight')->andReturn(8);
516 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
517 $treeBounds->shouldReceive(
'getUploadId')->andReturn(102);
519 $this->uploadDao->shouldReceive(
'getGlobalDecisionSettingsFromInfo')
520 ->withArgs([102])->andReturn(
false);
522 $map = $this->clearingDao->getClearedLicenseIdAndMultiplicities($treeBounds, $groupId);
523 assertThat($map, is(array(
'FOO'=>array(
'count'=>2,
'shortname'=>
'FOO',
'spdx_id'=>
'FOO',
'rf_pk'=>401))));
526 public function testGetClearedLicenses()
534 $this->buildProposals(array(array($item,$user,$groupId,$rf,$isRm,$t),
535 array($item,$user,$groupId,$rf+1,!$isRm,$t+1)),$eventId=0);
536 $type = DecisionTypes::IDENTIFIED;
537 $scope = DecisionScopes::ITEM;
538 $this->buildDecisions(array( array( $item,$user,$groupId,$type,$t,$scope,array($eventId,$eventId+1) ) ));
539 $treeBounds = M::mock(ItemTreeBounds::class);
541 $treeBounds->shouldReceive(
'getLeft')->andReturn(1);
542 $treeBounds->shouldReceive(
'getRight')->andReturn(8);
543 $treeBounds->shouldReceive(
'getUploadTreeTableName')->andReturn(
"uploadtree");
544 $treeBounds->shouldReceive(
'getUploadId')->andReturn(102);
546 $this->uploadDao->shouldReceive(
'getGlobalDecisionSettingsFromInfo')
547 ->withArgs([102])->andReturn(
false);
549 $map = $this->clearingDao->getClearedLicenses($treeBounds, $groupId);
550 assertThat($map, equalTo(array(
new LicenseRef($rf,
'FOO',
'foo full',
'FOO'))));
554 public function testMainLicenseIds()
556 $this->testDb->createPlainTables(array(
'upload_clearing_license'));
558 $mainLicIdsInitially = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
559 assertThat($mainLicIdsInitially, is(emptyArray()));
561 $this->clearingDao->makeMainLicense($uploadId,$this->groupId,$licenseId=402);
562 $mainLicIdsAfterAddingOne = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
563 assertThat($mainLicIdsAfterAddingOne, arrayContaining(array($licenseId)));
565 $this->clearingDao->makeMainLicense($uploadId,$this->groupId,$licenseId);
566 $mainLicIdsAfterAddingOneTwice = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
567 assertThat($mainLicIdsAfterAddingOneTwice, is(arrayWithSize(1)));
569 $this->clearingDao->makeMainLicense($uploadId,$this->groupId,$licenseId2=403);
570 $mainLicIdsAfterAddingOther = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
571 assertThat($mainLicIdsAfterAddingOther, arrayContainingInAnyOrder(array($licenseId,$licenseId2)));
573 $this->clearingDao->removeMainLicense($uploadId,$this->groupId,$licenseId2);
574 $mainLicIdsAfterRemovingOne = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
575 assertThat($mainLicIdsAfterRemovingOne, is(arrayWithSize(1)));
577 $this->clearingDao->removeMainLicense($uploadId,$this->groupId,$licenseId2);
578 $mainLicIdAfterRemovingSomethingNotInSet = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
579 assertThat($mainLicIdAfterRemovingSomethingNotInSet, is(arrayWithSize(1)));
581 $this->clearingDao->removeMainLicense($uploadId,$this->groupId+1,$licenseId);
582 $mainLicIdAfterInsertToOtherGroup = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
583 assertThat($mainLicIdAfterInsertToOtherGroup, is(arrayWithSize(1)));
585 $this->clearingDao->removeMainLicense($uploadId+1,$this->groupId,$licenseId);
586 $mainLicIdAfterInsertToOtherUpload = $this->clearingDao->getMainLicenseIds($uploadId, $this->groupId);
587 assertThat($mainLicIdAfterInsertToOtherUpload, is(arrayWithSize(1)));
590 public function testupdateClearingEvent()
592 $this->testDb->createSequences(array(
'clearing_event_clearing_event_pk_seq'));
593 $this->testDb->createConstraints(array(
'clearing_event_pkey'));
594 $this->
dbManager->queryOnce(
"ALTER TABLE clearing_event ALTER COLUMN clearing_event_pk SET DEFAULT nextval('clearing_event_clearing_event_pk_seq'::regclass)");
596 $this->clearingDao->updateClearingEvent($uploadTreeId=301, $userId=1, $groupId=1, $licenseId=402, $what=
'comment', $changeCom=
'abc123');
597 $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');
598 assertThat($rowPast[
'comment'],equalTo($changeCom));
600 $this->clearingDao->updateClearingEvent($uploadTreeId, $userId, $groupId, $licenseId, $what=
'reportinfo', $changeRep=
'def456');
601 $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');
602 assertThat($rowFuture[
'comment'],equalTo($changeCom));
603 assertThat($rowFuture[
'reportinfo'],equalTo($changeRep));
testKotobaHistoryDistinguishesMatchedFromTriedOnly()
testKotobaHistoryGroupsAddedAndRemovedLicensesOfSamePhrase()
testKotobaHistoryEmptyWhenNoDecisionsRecordedYet()
fo_dbManager * dbManager
fo_dbManager object