FOSSology  4.4.0
Open Source License Compliance by Open Source Software
SampleTestRunner.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2010 Hewlett-Packard Development Company, L.P.
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
16 /* every test must use these includes, adjust the paths based on where the
17  * tests are in the source tree.
18  */
19 require_once ('TestEnvironment.php');
20 require_once ('fossologyTestCase.php');
21 
22 global $URL;
23 
25 {
26  public $mybrowser;
27  public $testFolder;
28 
29  /*
30  * setUp is called before any other method by default.
31  *
32  * If other actions like creating a folder or something are needed,
33  * put them in the setUp method after login.
34  *
35  */
36  function setUp()
37  {
38  return(TRUE);
39  }
40 /* all runnable test names (methods/functions) must start with 'test' */
41  function testmytest()
42  {
43  // exec your test. The test should return 0 for pass 1 for fail
44  // the test can pass back more, but it must indicate pass and fail
45  $last = exec("pathToTest", $output, $rtn);
46  if ($rtn == 0) {
47  $this->pass();
48  }
49  else {
50  $this->fail();
51  }
52  }
53  /* use the tearDown method to clean up after a test. This method like
54  * setUp will run after every test.
55  */
56 
57  function tearDown()
58  {
59  return(TRUE);
60  }
61 }