57 if ($version == ApiVersion::V2) {
60 "copyrightEmailAuthor" =>
"true",
71 "softwareHeritage" =>
true,
72 "compatibility" => false
77 "copyright_email_author" =>
"true",
89 "compatibility" => false
93 $expectedObject =
new Analysis(
true,
true,
true,
true,
false,
false,
false,
false,
true,
false,
false,
true,
true,
true);
96 $actualObject->setUsingArray($analysisArray, $version);
98 $this->assertEquals($expectedObject, $actualObject);
109 $analysisString =
"bucket, ecc, keyword, scanoss, ipra, softwareHeritage";
112 $expectedObject->setBucket(
true);
113 $expectedObject->setEcc(
true);
114 $expectedObject->setKeyword(
true);
115 $expectedObject->setScanoss(
true);
116 $expectedObject->setIpra(
true);
117 $expectedObject->setSoftwareHeritage(
true);
120 $actualObject->setUsingString($analysisString);
122 $this->assertEquals($expectedObject, $actualObject);
156 if($version==ApiVersion::V2){
159 "copyrightEmailAuthor" =>
true,
170 "softwareHeritage" =>
true,
171 "compatibility" => true
176 "copyright_email_author" =>
true,
188 "compatibility" => true
192 $actualObject =
new Analysis(
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true);
194 $this->assertEquals($expectedArray, $actualObject->getArray($version));
206 $this->assertTrue($analysis->getBucket());
216 $analysis->setBucket(
true);
217 $this->assertTrue($analysis->getBucket());
226 $analysis =
new Analysis(
false,
true);
227 $this->assertTrue($analysis->getCopyright());
237 $analysis->setCopyright(
true);
238 $this->assertTrue($analysis->getCopyright());
247 $analysis =
new Analysis(
false,
false,
true);
248 $this->assertTrue($analysis->getEcc());
258 $analysis->setEcc(
true);
259 $this->assertTrue($analysis->getEcc());
268 $analysis =
new Analysis(
false,
false,
false,
true);
269 $this->assertTrue($analysis->getKeyword());
279 $analysis->setKeyword(
true);
280 $this->assertTrue($analysis->getKeyword());
289 $analysis =
new Analysis(
false,
false,
false,
false,
true);
290 $this->assertTrue($analysis->getMime());
300 $analysis->setMime(
true);
301 $this->assertTrue($analysis->getMime());
310 $analysis =
new Analysis(
false,
false,
false,
false,
false,
true);
311 $this->assertTrue($analysis->getMonk());
314 public function testScanoss()
317 $analysis->setScanoss(
true);
318 $this->assertTrue($analysis->getScanoss());
321 public function testIpra()
323 $analysis =
new Analysis();
324 $analysis->setIpra(
true);
325 $this->assertTrue($analysis->getIpra());
328 public function testSoftwareHeritage()
330 $analysis =
new Analysis();
331 $analysis->setSoftwareHeritage(
true);
332 $this->assertTrue($analysis->getSoftwareHeritage());
335 public function testPkgagent()
337 $analysis =
new Analysis();
338 $analysis->setPkgagent(
true);
339 $this->assertTrue($analysis->getPkgagent());
342 public function testCompatibility()
344 $analysis =
new Analysis();
345 $analysis->setCompatibility(
true);
346 $this->assertTrue($analysis->getCompatibility());
Model to hold analysis settings.
Tests for Analysis model.
testSetUsingArray($version)