public function testGetUnhandledScannerDetectedLicensesWithMappedMatch() { /** @var LicenseRef $licenseRef */ list($scannerResults, $licenseRef) = $this->createScannerDetectedLicenses(); $offset = 0; $clearingEvent = $this->createClearingEvent($eventId = 123, $this->timestamp, $licenseRef->getId() + $offset, $licenseRef->getShortName(), $licenseRef->getFullName()); $this->clearingDao->shouldReceive("getRelevantClearingEvents")->with($this->itemTreeBounds, $this->groupId)->andReturn(array($clearingEvent->getLicenseId() => $clearingEvent)); $this->agentLicenseEventProcessor->shouldReceive("getScannerEvents")->with($this->itemTreeBounds, LicenseMap::CONCLUSION)->andReturn($scannerResults); $licenseMap = M::mock(LicenseMap::classname()); $licenseMap->shouldReceive('getProjectedId')->andReturnUsing(function ($id) { return $id; }); $licenseMap->shouldReceive('getUsage')->andReturn(LicenseMap::CONCLUSION); $hasUnhandledScannerDetectedLicenses = $this->clearingDecisionProcessor->hasUnhandledScannerDetectedLicenses($this->itemTreeBounds, $this->groupId, array(), $licenseMap); assertThat($hasUnhandledScannerDetectedLicenses, is(False)); }