44
44
namespace SebastianBergmann \Diff ;
45
45
46
46
use PHPUnit_Framework_TestCase ;
47
+ use SebastianBergmann \Diff \LCS \MemoryEfficientImplementation ;
48
+ use SebastianBergmann \Diff \LCS \TimeEfficientImplementation ;
47
49
48
50
class DifferTest extends PHPUnit_Framework_TestCase
49
51
{
@@ -68,9 +70,9 @@ protected function setUp()
68
70
* @dataProvider arrayProvider
69
71
* @covers SebastianBergmann\Diff\Differ::diffToArray
70
72
*/
71
- public function testArrayRepresentationOfDiffCanBeRendered (array $ expected , $ from , $ to )
73
+ public function testArrayRepresentationOfDiffCanBeRenderedUsingTimeEfficientLcsImplementation (array $ expected , $ from , $ to )
72
74
{
73
- $ this ->assertEquals ($ expected , $ this ->differ ->diffToArray ($ from , $ to ));
75
+ $ this ->assertEquals ($ expected , $ this ->differ ->diffToArray ($ from , $ to, new TimeEfficientImplementation ));
74
76
}
75
77
76
78
/**
@@ -80,9 +82,33 @@ public function testArrayRepresentationOfDiffCanBeRendered(array $expected, $fro
80
82
* @dataProvider textProvider
81
83
* @covers SebastianBergmann\Diff\Differ::diff
82
84
*/
83
- public function testTextRepresentationOfDiffCanBeRendered ($ expected , $ from , $ to )
85
+ public function testTextRepresentationOfDiffCanBeRenderedUsingTimeEfficientLcsImplementation ($ expected , $ from , $ to )
84
86
{
85
- $ this ->assertEquals ($ expected , $ this ->differ ->diff ($ from , $ to ));
87
+ $ this ->assertEquals ($ expected , $ this ->differ ->diff ($ from , $ to , new TimeEfficientImplementation ));
88
+ }
89
+
90
+ /**
91
+ * @param array $expected
92
+ * @param string $from
93
+ * @param string $to
94
+ * @dataProvider arrayProvider
95
+ * @covers SebastianBergmann\Diff\Differ::diffToArray
96
+ */
97
+ public function testArrayRepresentationOfDiffCanBeRenderedUsingMemoryEfficientLcsImplementation (array $ expected , $ from , $ to )
98
+ {
99
+ $ this ->assertEquals ($ expected , $ this ->differ ->diffToArray ($ from , $ to , new MemoryEfficientImplementation ));
100
+ }
101
+
102
+ /**
103
+ * @param string $expected
104
+ * @param string $from
105
+ * @param string $to
106
+ * @dataProvider textProvider
107
+ * @covers SebastianBergmann\Diff\Differ::diff
108
+ */
109
+ public function testTextRepresentationOfDiffCanBeRenderedUsingMemoryEfficientLcsImplementation ($ expected , $ from , $ to )
110
+ {
111
+ $ this ->assertEquals ($ expected , $ this ->differ ->diff ($ from , $ to , new MemoryEfficientImplementation ));
86
112
}
87
113
88
114
public function arrayProvider ()
0 commit comments