8 namespace Fossology\Lib\Data;
21 private $licenseFileId;
33 private $agentRevision;
35 private $licenseMatch;
37 protected function setUp() :
void
40 $this->shortName =
"testSN";
41 $this->spdxId =
"testSN";
42 $this->fullName =
"testFN";
43 $this->licenseRef =
new LicenseRef($this->
id, $this->shortName, $this->fullName, $this->spdxId);
46 $this->agentName =
"Monk";
47 $this->agentRevision =
"AgentRev";
48 $this->agentRef =
new AgentRef($this->agentId, $this->agentName, $this->agentRevision);
52 $this->licenseFileId = 12;
54 $this->licenseMatch =
new LicenseMatch($this->fileId, $this->licenseRef, $this->agentRef, $this->licenseFileId, $this->percent);
56 $this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
59 protected function tearDown() :
void
61 $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
64 public function testGetFileId()
66 assertThat($this->licenseMatch->getFileId(), is($this->fileId));
69 public function testGetLicenseFileId()
71 assertThat($this->licenseMatch->getLicenseFileId(), is($this->licenseFileId));
74 public function testGetLicenseRef()
76 assertThat($this->licenseMatch->getLicenseRef(), is($this->licenseRef));
79 public function testGetAgentRef()
81 assertThat($this->licenseMatch->getAgentRef(), is($this->agentRef));
82 assertThat($this->licenseMatch->getAgentRef(), is(
new AgentRef($this->agentId, $this->agentName, $this->agentRevision)));
85 public function testGetPercent()
87 assertThat($this->licenseMatch->getPercentage(), is($this->percent));
90 public function testGetLicenseId()
92 assertThat($this->licenseMatch->getLicenseId(), equalTo($this->
id));