1
1
<?php
2
2
3
- namespace Diff \ Renderer ;
3
+ namespace Tests \ Diff ;
4
4
5
5
use jblond \Diff \SequenceMatcher ;
6
6
use PHPUnit \Framework \TestCase ;
10
10
*
11
11
* PHP version 7.2 or greater
12
12
*
13
- * @package Tests\Diff
14
- * @author Mario Brandt <[email protected] >
15
- * @author Ferry Cools <[email protected] >
13
+ * @package Tests\Diff
14
+ * @author Mario Brandt <[email protected] >
15
+ * @author Ferry Cools <[email protected] >
16
16
* @copyright (c) 2009 Mario Brandt
17
- * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18
- * @version 2.3.0
19
- * @link https://github.com/JBlond/php-diff
17
+ * @license New BSD License http://www.opensource.org/licenses/bsd-license.php
18
+ * @version 2.3.0
19
+ * @link https://github.com/JBlond/php-diff
20
20
*/
21
-
22
21
class SequenceMatcherTest extends TestCase
23
22
{
24
-
25
23
/**
26
- * SequenceMatcherTest constructor.
27
- *
28
- * @param null $name
29
- * @param array $data
30
- * @param string $dataName
24
+ * Test the opCodes of the differences between version1 and version2 with the default options.
31
25
*/
32
- public function __construct ($ name = null , array $ data = [], $ dataName = '' )
33
- {
34
- parent ::__construct ($ name , $ data , $ dataName );
35
- }
36
-
37
26
public function testGetGroupedOpCodesDefault ()
38
27
{
39
28
// Test with default options.
@@ -45,8 +34,10 @@ public function testGetGroupedOpCodesDefault()
45
34
$ this ->assertEquals (
46
35
[
47
36
[
48
- ['equal ' , 4 , 7 , 4 , 7 ], ['replace ' , 7 , 8 , 7 , 8 ], ['equal ' , 8 , 11 , 8 , 11 ]
49
- ]
37
+ ['equal ' , 4 , 7 , 4 , 7 ],
38
+ ['replace ' , 7 , 8 , 7 , 8 ],
39
+ ['equal ' , 8 , 11 , 8 , 11 ],
40
+ ],
50
41
],
51
42
$ sequenceMatcher ->getGroupedOpCodes ()
52
43
);
@@ -83,10 +74,7 @@ public function testGetGroupedOpCodesIgnoreWhitespaceTrue()
83
74
['ignoreWhitespace ' => true ]
84
75
);
85
76
86
- $ this ->assertEquals (
87
- [],
88
- $ sequenceMatcher ->getGroupedOpCodes ()
89
- );
77
+ $ this ->assertEquals ([], $ sequenceMatcher ->getGroupedOpCodes ());
90
78
}
91
79
92
80
public function testGetGroupedOpCodesIgnoreCaseTrue ()
@@ -98,9 +86,6 @@ public function testGetGroupedOpCodesIgnoreCaseTrue()
98
86
['ignoreCase ' => true ]
99
87
);
100
88
101
- $ this ->assertEquals (
102
- [],
103
- $ sequenceMatcher ->getGroupedOpCodes ()
104
- );
89
+ $ this ->assertEquals ([], $ sequenceMatcher ->getGroupedOpCodes ());
105
90
}
106
91
}
0 commit comments