Skip to content

Commit 34a032f

Browse files
committed
Fix property visibility and unused code
1 parent 5ba19f7 commit 34a032f

File tree

1 file changed

+9
-31
lines changed

1 file changed

+9
-31
lines changed

tests/Diff/Renderer/MainRendererTest.php

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,25 @@ class MainRendererTest extends TestCase
3737
/**
3838
* @var string[] Defines the main renderer options.
3939
*/
40-
public $rendererOptions = [
40+
private $rendererOptions = [
4141
'format' => 'html',
4242
];
4343

4444
/**
45-
* MainRendererTest constructor.
46-
*
47-
* @param null $name
48-
* @param array $data
49-
* @param string $dataName
50-
*/
51-
public function __construct($name = null, array $data = [], $dataName = '')
52-
{
53-
//new \jblond\Autoloader();
54-
parent::__construct($name, $data, $dataName);
55-
}
56-
57-
/**
58-
*
45+
* Test if a sequence of version1 which is removed from version2 is caught by the MainRenderer.
5946
*/
6047
public function testRenderSimpleDelete()
6148
{
6249
$renderer = new MainRenderer();
63-
$renderer->diff = new Diff(
64-
['a'],
65-
[]
66-
);
67-
$result = $this->invokeMethod($renderer, 'renderSequences');
50+
$renderer->diff = new Diff(['a'], []);
6851
static::assertEquals(
6952
[
7053
[
7154
[
7255
'tag' => 'delete',
7356
'base' => [
7457
'offset' => 0,
75-
'lines' => [
76-
'a',
77-
],
58+
'lines' => ['a'],
7859
],
7960
'changed' => [
8061
'offset' => 0,
@@ -83,7 +64,7 @@ public function testRenderSimpleDelete()
8364
],
8465
],
8566
],
86-
$result
67+
$this->invokeMethod($renderer, 'renderSequences')
8768
);
8869
}
8970

@@ -94,7 +75,7 @@ public function testRenderSimpleDelete()
9475
* @param string $methodName Method name to call
9576
* @param array $parameters Array of parameters to pass into method.
9677
*
97-
* @return mixed Method return.
78+
* @return mixed The return value of the invoked method.
9879
* @throws ReflectionException If the class doesn't exist.
9980
*/
10081
public function invokeMethod(object $object, string $methodName, array $parameters = [])
@@ -107,7 +88,7 @@ public function invokeMethod(object $object, string $methodName, array $paramete
10788
}
10889

10990
/**
110-
*
91+
* Test if leading spaces of a sequence are replaced with html entities.
11192
*/
11293
public function testRenderFixesSpaces()
11394
{
@@ -116,7 +97,6 @@ public function testRenderFixesSpaces()
11697
[' a'],
11798
['a']
11899
);
119-
$result = $this->invokeMethod($renderer, 'renderSequences');
120100

121101
static::assertEquals(
122102
[
@@ -131,14 +111,12 @@ public function testRenderFixesSpaces()
131111
],
132112
'changed' => [
133113
'offset' => 0,
134-
'lines' => [
135-
"\0\1a",
136-
],
114+
'lines' => ["\0\1a"],
137115
],
138116
],
139117
],
140118
],
141-
$result
119+
$this->invokeMethod($renderer, 'renderSequences')
142120
);
143121
}
144122

0 commit comments

Comments
 (0)