forked from chrisboulton/php-diff
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Diff\Renderer; | ||
namespace Tests\Diff; | ||
|
||
use jblond\Diff\SequenceMatcher; | ||
use PHPUnit\Framework\TestCase; | ||
|
@@ -10,30 +10,19 @@ | |
* | ||
* PHP version 7.2 or greater | ||
* | ||
* @package Tests\Diff | ||
* @author Mario Brandt <[email protected]> | ||
* @author Ferry Cools <[email protected]> | ||
* @package Tests\Diff | ||
* @author Mario Brandt <[email protected]> | ||
* @author Ferry Cools <[email protected]> | ||
* @copyright (c) 2009 Mario Brandt | ||
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php | ||
* @version 2.3.0 | ||
* @link https://github.com/JBlond/php-diff | ||
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php | ||
* @version 2.3.0 | ||
* @link https://github.com/JBlond/php-diff | ||
*/ | ||
|
||
class SequenceMatcherTest extends TestCase | ||
{ | ||
|
||
/** | ||
* SequenceMatcherTest constructor. | ||
* | ||
* @param null $name | ||
* @param array $data | ||
* @param string $dataName | ||
* Test the opCodes of the differences between version1 and version2 with the default options. | ||
*/ | ||
public function __construct($name = null, array $data = [], $dataName = '') | ||
{ | ||
parent::__construct($name, $data, $dataName); | ||
} | ||
|
||
public function testGetGroupedOpCodesDefault() | ||
{ | ||
// Test with default options. | ||
|
@@ -45,8 +34,10 @@ public function testGetGroupedOpCodesDefault() | |
$this->assertEquals( | ||
[ | ||
[ | ||
['equal', 4, 7, 4, 7], ['replace', 7, 8, 7, 8], ['equal', 8, 11, 8, 11] | ||
] | ||
['equal', 4, 7, 4, 7], | ||
['replace', 7, 8, 7, 8], | ||
['equal', 8, 11, 8, 11], | ||
], | ||
], | ||
$sequenceMatcher->getGroupedOpCodes() | ||
); | ||
|
@@ -83,10 +74,7 @@ public function testGetGroupedOpCodesIgnoreWhitespaceTrue() | |
['ignoreWhitespace' => true] | ||
); | ||
|
||
$this->assertEquals( | ||
[], | ||
$sequenceMatcher->getGroupedOpCodes() | ||
); | ||
$this->assertEquals([], $sequenceMatcher->getGroupedOpCodes()); | ||
} | ||
|
||
public function testGetGroupedOpCodesIgnoreCaseTrue() | ||
|
@@ -98,9 +86,6 @@ public function testGetGroupedOpCodesIgnoreCaseTrue() | |
['ignoreCase' => true] | ||
); | ||
|
||
$this->assertEquals( | ||
[], | ||
$sequenceMatcher->getGroupedOpCodes() | ||
); | ||
$this->assertEquals([], $sequenceMatcher->getGroupedOpCodes()); | ||
} | ||
} |