@@ -37,44 +37,25 @@ class MainRendererTest extends TestCase
37
37
/**
38
38
* @var string[] Defines the main renderer options.
39
39
*/
40
- public $ rendererOptions = [
40
+ private $ rendererOptions = [
41
41
'format ' => 'html ' ,
42
42
];
43
43
44
44
/**
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.
59
46
*/
60
47
public function testRenderSimpleDelete ()
61
48
{
62
49
$ renderer = new MainRenderer ();
63
- $ renderer ->diff = new Diff (
64
- ['a ' ],
65
- []
66
- );
67
- $ result = $ this ->invokeMethod ($ renderer , 'renderSequences ' );
50
+ $ renderer ->diff = new Diff (['a ' ], []);
68
51
static ::assertEquals (
69
52
[
70
53
[
71
54
[
72
55
'tag ' => 'delete ' ,
73
56
'base ' => [
74
57
'offset ' => 0 ,
75
- 'lines ' => [
76
- 'a ' ,
77
- ],
58
+ 'lines ' => ['a ' ],
78
59
],
79
60
'changed ' => [
80
61
'offset ' => 0 ,
@@ -83,7 +64,7 @@ public function testRenderSimpleDelete()
83
64
],
84
65
],
85
66
],
86
- $ result
67
+ $ this -> invokeMethod ( $ renderer , ' renderSequences ' )
87
68
);
88
69
}
89
70
@@ -94,7 +75,7 @@ public function testRenderSimpleDelete()
94
75
* @param string $methodName Method name to call
95
76
* @param array $parameters Array of parameters to pass into method.
96
77
*
97
- * @return mixed Method return.
78
+ * @return mixed The return value of the invoked method .
98
79
* @throws ReflectionException If the class doesn't exist.
99
80
*/
100
81
public function invokeMethod (object $ object , string $ methodName , array $ parameters = [])
@@ -107,7 +88,7 @@ public function invokeMethod(object $object, string $methodName, array $paramete
107
88
}
108
89
109
90
/**
110
- *
91
+ * Test if leading spaces of a sequence are replaced with html entities.
111
92
*/
112
93
public function testRenderFixesSpaces ()
113
94
{
@@ -116,7 +97,6 @@ public function testRenderFixesSpaces()
116
97
[' a ' ],
117
98
['a ' ]
118
99
);
119
- $ result = $ this ->invokeMethod ($ renderer , 'renderSequences ' );
120
100
121
101
static ::assertEquals (
122
102
[
@@ -131,14 +111,12 @@ public function testRenderFixesSpaces()
131
111
],
132
112
'changed ' => [
133
113
'offset ' => 0 ,
134
- 'lines ' => [
135
- "\0\1a " ,
136
- ],
114
+ 'lines ' => ["\0\1a " ],
137
115
],
138
116
],
139
117
],
140
118
],
141
- $ result
119
+ $ this -> invokeMethod ( $ renderer , ' renderSequences ' )
142
120
);
143
121
}
144
122
0 commit comments