File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Jfcherng \Diff \Test \Renderer ;
6
+
7
+ use Jfcherng \Diff \DiffHelper ;
8
+ use Jfcherng \Diff \Renderer \AbstractRenderer ;
9
+ use Jfcherng \Diff \Utility \Language ;
10
+ use PHPUnit \Framework \TestCase ;
11
+
12
+ /**
13
+ * Test general methods from the AbstractRenderer.
14
+ *
15
+ * @coversNothing
16
+ *
17
+ * @internal
18
+ */
19
+ final class RendererTest extends TestCase
20
+ {
21
+ /**
22
+ * Test the AbstractRenderer::setOptions with custom language array.
23
+ *
24
+ * @covers \Jfcherng\Diff\Renderer\AbstractRenderer::setOptions
25
+ */
26
+ public function testSetOptionsWithCustomLanguageArray (): void
27
+ {
28
+ $ languageArrayDefault = (new Language ('eng ' ))->getTranslations ();
29
+ $ languageArrayTest = ['differences ' => '_TEST_MARKER_ ' ] + $ languageArrayDefault ;
30
+
31
+ $ diffResult = DiffHelper::calculate (
32
+ 'foo ' ,
33
+ 'bar ' ,
34
+ 'Inline ' ,
35
+ [],
36
+ ['language ' => $ languageArrayTest ]
37
+ );
38
+
39
+ static ::assertStringContainsString (
40
+ '_TEST_MARKER_ ' ,
41
+ $ diffResult ,
42
+ 'Rederer options: custom "language" array should work. '
43
+ );
44
+ }
45
+ }
You can’t perform that action at this time.
0 commit comments