9 namespace Fossology\Lib\Data;
14 private $shortName =
"<shortName>";
15 private $fullName =
"<fullName>";
16 private $spdxId =
"<spdxId>";
23 protected function setUp() :
void
25 $this->licenseRef =
new LicenseRef($this->
id, $this->shortName, $this->fullName, $this->spdxId);
28 public function testGetId()
30 assertThat($this->licenseRef->getId(), is($this->
id));
33 public function testGetShortName()
35 assertThat($this->licenseRef->getShortName(), is($this->shortName));
38 public function testGetFullName()
40 assertThat($this->licenseRef->getFullName(), is($this->fullName));
43 public function testGetSpdxId()
45 assertThat($this->licenseRef->getSpdxId(), is($this->spdxId));
48 public function testDefaultSpdxId()
50 $licenseRef =
new LicenseRef($this->
id, $this->shortName, $this->fullName,
"");
51 assertThat($licenseRef->getSpdxId(), is(
"LicenseRef-fossology-shortName"));
54 public function testMidStringPlusConvertedToOrLater()
56 $licenseRef =
new LicenseRef($this->
id,
"GPL-2.0+-with-bison-exception", $this->fullName,
"");
57 assertThat($licenseRef->getSpdxId(), is(
"LicenseRef-fossology-GPL-2.0-or-later-with-bison-exception"));
60 public function testTrailingPlusStillConvertedToOrLater()
62 $licenseRef =
new LicenseRef($this->
id,
"GPL-2.0+", $this->fullName,
"");
63 assertThat($licenseRef->getSpdxId(), is(
"LicenseRef-fossology-GPL-2.0-or-later"));