Tests are now compliant with php-cs-fixer (CamelCase for method, phpdoc valid)
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
<?php
|
||||
|
||||
/** DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
/**
|
||||
* DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
|
||||
namespace Domframework\Tests;
|
||||
|
||||
use Domframework\Xdiff;
|
||||
|
||||
/** Test the domframework xdiff part */
|
||||
/**
|
||||
* Test the domframework xdiff part
|
||||
*/
|
||||
class XdiffTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
// Declaration of $string1 and $string2
|
||||
// {{{
|
||||
// Declaration of $string1 and $string2
|
||||
// {{{
|
||||
private $string1 = "This part of the
|
||||
document has stayed the
|
||||
same from version to
|
||||
@@ -70,11 +73,11 @@ This paragraph contains
|
||||
important new additions
|
||||
to this document.
|
||||
";
|
||||
// }}}
|
||||
// }}}
|
||||
|
||||
public function testDiffNormal1()
|
||||
{
|
||||
// Mode normal
|
||||
// Mode normal
|
||||
$xdiff = new Xdiff();
|
||||
$res = $xdiff->diff($this->string1, $this->string2);
|
||||
$this->assertSame($res, "0a1,6
|
||||
@@ -104,7 +107,7 @@ to this document.
|
||||
|
||||
public function testDiffNormal2()
|
||||
{
|
||||
// Mode normal
|
||||
// Mode normal
|
||||
$xdiff = new Xdiff();
|
||||
$res = $xdiff->diff("NEWLINE\n" . $this->string1, $this->string2);
|
||||
$this->assertSame($res, "1c1,6
|
||||
@@ -134,9 +137,9 @@ to this document.
|
||||
");
|
||||
}
|
||||
|
||||
public function test_diff_normal_3()
|
||||
public function testDiffNormal3()
|
||||
{
|
||||
// Mode normal
|
||||
// Mode normal
|
||||
$xdiff = new Xdiff();
|
||||
$res = $xdiff->diff("NEWLINE\n", "\n");
|
||||
$this->assertSame($res, "1c1
|
||||
@@ -148,7 +151,7 @@ to this document.
|
||||
|
||||
public function testDiffNormal4()
|
||||
{
|
||||
// Mode normal
|
||||
// Mode normal
|
||||
$xdiff = new Xdiff();
|
||||
$res = $xdiff->diff("\n", "NEWLINE\n");
|
||||
$this->assertSame($res, "1c1
|
||||
@@ -183,11 +186,11 @@ to this document.
|
||||
|
||||
public function testDiffUnified1()
|
||||
{
|
||||
// Mode unified
|
||||
// Mode unified
|
||||
$xdiff = new Xdiff("unified");
|
||||
$res = $xdiff->diff($this->string1, $this->string2);
|
||||
$date = date("Y-m-d H:i:s.u00");
|
||||
// DST must answer +0200 in winter and +0100 in summer
|
||||
// DST must answer +0200 in winter and +0100 in summer
|
||||
$dst = date("O");
|
||||
$this->assertSame($res, "--- Original {$date}0 $dst
|
||||
+++ New {$date}1 $dst
|
||||
@@ -217,7 +220,7 @@ to this document.
|
||||
|
||||
public function testDiffUnified2()
|
||||
{
|
||||
// Mode unified
|
||||
// Mode unified
|
||||
$xdiff = new Xdiff("unified");
|
||||
$res = $xdiff->diff("NEWLINE\n" . $this->string1, $this->string2);
|
||||
$this->assertSame($res, "--- Original " . date("Y-m-d H:i:s.u000 O") . "
|
||||
|
||||
Reference in New Issue
Block a user