FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
HighlightTest.php
1 <?php
2 /*
3 Copyright (C) 2014, Siemens AG
4 Author: Andreas Würl
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 version 2 as published by the Free Software Foundation.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 
20 namespace Fossology\Lib\Data;
21 
23 use Mockery as M;
24 
25 class HighlightTest extends \PHPUnit\Framework\TestCase
26 {
27  private $start = 10;
28  private $end = 12;
29  private $type = "M";
30  private $licenseId = 321;
31  private $refStart = 2;
32  private $refEnd = 3;
33  private $infoText = "<infoText>";
34 
38  private $htmlElement;
39 
43  private $highlight;
44 
45  protected function setUp()
46  {
47  $this->htmlElement = M::mock('Fossology\Lib\Html\HtmlElement');
48 
49  $this->highlight = new Highlight($this->start, $this->end, $this->type, $this->refStart, $this->refEnd, $this->infoText, $this->htmlElement);
50  $this->highlight->setLicenseId($this->licenseId);
51  }
52 
53  protected function tearDown()
54  {
55  M::close();
56  }
57 
58  public function testGetStart()
59  {
60  assertThat($this->highlight->getStart(), is($this->start));
61  }
62 
63  public function testGetEnd()
64  {
65  assertThat($this->highlight->getEnd(), is($this->end));
66  }
67 
68  public function testGetType()
69  {
70  assertThat($this->highlight->getType(), is($this->type));
71  }
72 
73  public function testGetLicenseId()
74  {
75  assertThat($this->highlight->getLicenseId(), is($this->licenseId));
76  }
77 
78  public function testGetRefStart()
79  {
80  assertThat($this->highlight->getRefStart(), is($this->refStart));
81  }
82 
83  public function testGetRefEnd()
84  {
85  assertThat($this->highlight->getRefEnd(), is($this->refEnd));
86  }
87 
88  public function testSetInfoText()
89  {
90  assertThat($this->highlight->getInfoText(), is($this->infoText));
91  }
92 
93  public function testGetInfoText()
94  {
95  assertThat($this->highlight->getInfoText(), is($this->infoText));
96  }
97 
98  public function testGetHtmlElement()
99  {
100  assertThat($this->highlight->getHtmlElement(), is($this->htmlElement));
101  }
102 }
start($application)
start the application Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d
Definition: pkgConfig.php:1225