FOSSology  4.4.0
Open Source License Compliance by Open Source Software
HighlightTest.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2014 Siemens AG
4  Author: Andreas Würl
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 
9 namespace Fossology\Lib\Data;
10 
12 use Mockery as M;
13 
14 class HighlightTest extends \PHPUnit\Framework\TestCase
15 {
16  private $start = 10;
17  private $end = 12;
18  private $type = "M";
19  private $licenseId = 321;
20  private $refStart = 2;
21  private $refEnd = 3;
22  private $infoText = "<infoText>";
23 
27  private $htmlElement;
28 
32  private $highlight;
33 
34  protected function setUp() : void
35  {
36  $this->htmlElement = M::mock('Fossology\Lib\Html\HtmlElement');
37 
38  $this->highlight = new Highlight($this->start, $this->end, $this->type, $this->refStart, $this->refEnd, $this->infoText, $this->htmlElement);
39  $this->highlight->setLicenseId($this->licenseId);
40  }
41 
42  protected function tearDown() : void
43  {
44  M::close();
45  }
46 
47  public function testGetStart()
48  {
49  assertThat($this->highlight->getStart(), is($this->start));
50  }
51 
52  public function testGetEnd()
53  {
54  assertThat($this->highlight->getEnd(), is($this->end));
55  }
56 
57  public function testGetType()
58  {
59  assertThat($this->highlight->getType(), is($this->type));
60  }
61 
62  public function testGetLicenseId()
63  {
64  assertThat($this->highlight->getLicenseId(), is($this->licenseId));
65  }
66 
67  public function testGetRefStart()
68  {
69  assertThat($this->highlight->getRefStart(), is($this->refStart));
70  }
71 
72  public function testGetRefEnd()
73  {
74  assertThat($this->highlight->getRefEnd(), is($this->refEnd));
75  }
76 
77  public function testSetInfoText()
78  {
79  assertThat($this->highlight->getInfoText(), is($this->infoText));
80  }
81 
82  public function testGetInfoText()
83  {
84  assertThat($this->highlight->getInfoText(), is($this->infoText));
85  }
86 
87  public function testGetHtmlElement()
88  {
89  assertThat($this->highlight->getHtmlElement(), is($this->htmlElement));
90  }
91 }
start($application)
start the application Assumes application is restartable via /etc/init.d/<script>....
Definition: pkgConfig.php:1214