40 $this->assertInstanceOf(Analysis::class, $analysis);
70 if ($version == ApiVersion::V2) {
73 "copyrightEmailAuthor" =>
"true",
84 "softwareHeritage" =>
true,
85 "compatibility" => false
90 "copyright_email_author" =>
"true",
102 "compatibility" => false
106 $expectedObject =
new Analysis(
true,
true,
true,
true,
false,
false,
false,
false,
true,
false,
false,
true,
true,
true);
109 $actualObject->setUsingArray($analysisArray, $version);
111 $this->assertEquals($expectedObject, $actualObject);
122 $analysisString =
"bucket, ecc, keyword, scanoss, ipra, softwareHeritage";
125 $expectedObject->setBucket(
true);
126 $expectedObject->setEcc(
true);
127 $expectedObject->setKeyword(
true);
128 $expectedObject->setScanoss(
true);
129 $expectedObject->setIpra(
true);
130 $expectedObject->setSoftwareHeritage(
true);
133 $actualObject->setUsingString($analysisString);
135 $this->assertEquals($expectedObject, $actualObject);
169 if($version==ApiVersion::V2){
172 "copyrightEmailAuthor" =>
true,
183 "softwareHeritage" =>
true,
184 "compatibility" => true
189 "copyright_email_author" =>
true,
201 "compatibility" => true
205 $actualObject =
new Analysis(
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true);
207 $this->assertEquals($expectedArray, $actualObject->getArray($version));
219 $this->assertTrue($analysis->getBucket());
229 $analysis->setBucket(
true);
230 $this->assertTrue($analysis->getBucket());
239 $analysis =
new Analysis(
false,
true);
240 $this->assertTrue($analysis->getCopyright());
250 $analysis->setCopyright(
true);
251 $this->assertTrue($analysis->getCopyright());
260 $analysis =
new Analysis(
false,
false,
true);
261 $this->assertTrue($analysis->getEcc());
271 $analysis->setEcc(
true);
272 $this->assertTrue($analysis->getEcc());
281 $analysis =
new Analysis(
false,
false,
false,
true);
282 $this->assertTrue($analysis->getKeyword());
292 $analysis->setKeyword(
true);
293 $this->assertTrue($analysis->getKeyword());
302 $analysis =
new Analysis(
false,
false,
false,
false,
true);
303 $this->assertTrue($analysis->getMime());
313 $analysis->setMime(
true);
314 $this->assertTrue($analysis->getMime());
323 $analysis =
new Analysis(
false,
false,
false,
false,
false,
true);
324 $this->assertTrue($analysis->getMonk());
327 public function testScanoss()
330 $analysis->setScanoss(
true);
331 $this->assertTrue($analysis->getScanoss());
334 public function testIpra()
336 $analysis =
new Analysis();
337 $analysis->setIpra(
true);
338 $this->assertTrue($analysis->getIpra());
341 public function testSoftwareHeritage()
343 $analysis =
new Analysis();
344 $analysis->setSoftwareHeritage(
true);
345 $this->assertTrue($analysis->getSoftwareHeritage());
348 public function testPkgagent()
350 $analysis =
new Analysis();
351 $analysis->setPkgagent(
true);
352 $this->assertTrue($analysis->getPkgagent());
355 public function testCompatibility()
357 $analysis =
new Analysis();
358 $analysis->setCompatibility(
true);
359 $this->assertTrue($analysis->getCompatibility());
Model to hold analysis settings.
Tests for Analysis model.
testSetUsingArray($version)