File tree Expand file tree Collapse file tree 4 files changed +74
-2
lines changed Expand file tree Collapse file tree 4 files changed +74
-2
lines changed Original file line number Diff line number Diff line change
1
+ /vendor
Original file line number Diff line number Diff line change 21
21
"php" : " >= 5.4" ,
22
22
"ext-mbstring" : " *"
23
23
},
24
+ "require-dev" : {
25
+ "phpunit/phpunit" : " ~5.5"
26
+ },
24
27
"autoload" : {
25
- "psr-0 " : {
26
- "Diff" : " lib/"
28
+ "psr-4 " : {
29
+ "jblond \\ Diff\\ " : " lib/jblond "
27
30
}
28
31
}
29
32
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace Tests \Diff \Renderer \Html ;
3
+ use jblond \Autoloader ;
4
+ use jblond \Diff \Renderer \Html \HtmlArray ;
5
+
6
+ require "../../../lib/Autoloader.php " ;
7
+ new Autoloader ();
8
+
9
+ class ArrayTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ public function testRenderSimpleDelete ()
12
+ {
13
+ $ htmlRenderer = new HtmlArray ();
14
+ $ htmlRenderer ->diff = new \jblond \Diff (
15
+ array ('a ' ),
16
+ array ()
17
+ );
18
+ $ result = $ htmlRenderer ->render ();
19
+ static ::assertEquals (array (
20
+ array (
21
+ array (
22
+ 'tag ' => 'delete ' ,
23
+ 'base ' => array (
24
+ 'offset ' => 0 ,
25
+ 'lines ' => array (
26
+ 'a '
27
+ )
28
+ ),
29
+ 'changed ' => array (
30
+ 'offset ' => 0 ,
31
+ 'lines ' => array ()
32
+ )
33
+ )
34
+ )
35
+ ), $ result );
36
+ }
37
+ public function testRenderFixesSpaces ()
38
+ {
39
+ $ htmlRenderer = new HtmlArray ();
40
+ $ htmlRenderer ->diff = new \jblond \Diff (
41
+ array (' a ' ),
42
+ array ('a ' )
43
+ );
44
+ $ result = $ htmlRenderer ->render ();
45
+ static ::assertEquals (array (
46
+ array (
47
+ array (
48
+ 'tag ' => 'replace ' ,
49
+ 'base ' => array (
50
+ 'offset ' => 0 ,
51
+ 'lines ' => array (
52
+ '<del> </del>a ' ,
53
+ )
54
+ ),
55
+ 'changed ' => array (
56
+ 'offset ' => 0 ,
57
+ 'lines ' => array (
58
+ '<ins></ins>a '
59
+ )
60
+ )
61
+ )
62
+ )
63
+ ), $ result );
64
+ }
65
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ //require_once __DIR__ .
3
+ require_once '../lib/Autoloader.php ' ;
You can’t perform that action at this time.
0 commit comments