Skip to content

Commit

Permalink
Fix property visibility and unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiLive authored and DigiLive committed Nov 19, 2020
1 parent 5ba19f7 commit 34a032f
Showing 1 changed file with 9 additions and 31 deletions.
40 changes: 9 additions & 31 deletions tests/Diff/Renderer/MainRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,25 @@ class MainRendererTest extends TestCase
/**
* @var string[] Defines the main renderer options.
*/
public $rendererOptions = [
private $rendererOptions = [
'format' => 'html',
];

/**
* MainRendererTest constructor.
*
* @param null $name
* @param array $data
* @param string $dataName
*/
public function __construct($name = null, array $data = [], $dataName = '')
{
//new \jblond\Autoloader();
parent::__construct($name, $data, $dataName);
}

/**
*
* Test if a sequence of version1 which is removed from version2 is caught by the MainRenderer.
*/
public function testRenderSimpleDelete()
{
$renderer = new MainRenderer();
$renderer->diff = new Diff(
['a'],
[]
);
$result = $this->invokeMethod($renderer, 'renderSequences');
$renderer->diff = new Diff(['a'], []);
static::assertEquals(
[
[
[
'tag' => 'delete',
'base' => [
'offset' => 0,
'lines' => [
'a',
],
'lines' => ['a'],
],
'changed' => [
'offset' => 0,
Expand All @@ -83,7 +64,7 @@ public function testRenderSimpleDelete()
],
],
],
$result
$this->invokeMethod($renderer, 'renderSequences')
);
}

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

/**
*
* Test if leading spaces of a sequence are replaced with html entities.
*/
public function testRenderFixesSpaces()
{
Expand All @@ -116,7 +97,6 @@ public function testRenderFixesSpaces()
[' a'],
['a']
);
$result = $this->invokeMethod($renderer, 'renderSequences');

static::assertEquals(
[
Expand All @@ -131,14 +111,12 @@ public function testRenderFixesSpaces()
],
'changed' => [
'offset' => 0,
'lines' => [
"\0\1a",
],
'lines' => ["\0\1a"],
],
],
],
],
$result
$this->invokeMethod($renderer, 'renderSequences')
);
}

Expand Down

0 comments on commit 34a032f

Please sign in to comment.