FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OneShot-none.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2012 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
14 require_once ('CommonCliTest.php');
15 
21 {
26  public $none;
27 
35  public function testOneShotnone()
36  {
37  /* check to see if the file exists */
38  $this->none = dirname(dirname(__FILE__)).'/testdata/noLic';
39  $this->assertFileExists($this->none,"OneShotnoneTest FAILURE! $this->none not found\n");
40 
41  list($output,) = $this->runNomos("",array($this->none));
42  list(,$fname,,,$license) = explode(' ', $output);
43 
44  $this->assertEquals($fname, 'noLic', "Error filename $fname does not equal noLic");
45  $this->assertEquals(trim($license), 'No_license_found', "Error license does not
46  equal No_license_found, $license was returned");
47  }
48 }
Tests for common CLI operations.
runNomos($args="", $files=array())
Run nomos using the arguments passed.
Perform a one-shot license analysis on a file with no license.
testOneShotnone()
Run NOMOS on file without license information.
char * trim(char *ptext)
Trimming whitespace.
Definition: fossconfig.c:690
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:308