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,
190 "copyright_email_author" =>
true,
202 "compatibility" =>
true,
203 "kotoba_bulk" => true
207 $actualObject =
new Analysis(
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
true);
209 $this->assertEquals($expectedArray, $actualObject->getArray($version));
221 $this->assertTrue($analysis->getBucket());
231 $analysis->setBucket(
true);
232 $this->assertTrue($analysis->getBucket());
241 $analysis =
new Analysis(
false,
true);
242 $this->assertTrue($analysis->getCopyright());
252 $analysis->setCopyright(
true);
253 $this->assertTrue($analysis->getCopyright());
262 $analysis =
new Analysis(
false,
false,
true);
263 $this->assertTrue($analysis->getEcc());
273 $analysis->setEcc(
true);
274 $this->assertTrue($analysis->getEcc());
283 $analysis =
new Analysis(
false,
false,
false,
true);
284 $this->assertTrue($analysis->getKeyword());
294 $analysis->setKeyword(
true);
295 $this->assertTrue($analysis->getKeyword());
304 $analysis =
new Analysis(
false,
false,
false,
false,
true);
305 $this->assertTrue($analysis->getMime());
315 $analysis->setMime(
true);
316 $this->assertTrue($analysis->getMime());
325 $analysis =
new Analysis(
false,
false,
false,
false,
false,
true);
326 $this->assertTrue($analysis->getMonk());
329 public function testScanoss()
332 $analysis->setScanoss(
true);
333 $this->assertTrue($analysis->getScanoss());
336 public function testIpra()
338 $analysis =
new Analysis();
339 $analysis->setIpra(
true);
340 $this->assertTrue($analysis->getIpra());
343 public function testSoftwareHeritage()
345 $analysis =
new Analysis();
346 $analysis->setSoftwareHeritage(
true);
347 $this->assertTrue($analysis->getSoftwareHeritage());
350 public function testPkgagent()
352 $analysis =
new Analysis();
353 $analysis->setPkgagent(
true);
354 $this->assertTrue($analysis->getPkgagent());
357 public function testCompatibility()
359 $analysis =
new Analysis();
360 $analysis->setCompatibility(
true);
361 $this->assertTrue($analysis->getCompatibility());
Model to hold analysis settings.
Tests for Analysis model.
testSetUsingArray($version)