File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ public function testSetOptions()
5353
5454 public function testSetOptionsFont ()
5555 {
56- Exporter::for (__DIR__ . '/../example.php ' )->export ($ this ->out , ['font ' => __DIR__ . '/../font/dejavu.ttf ' ]);
56+ Exporter::for (__DIR__ . '/../example.php ' )->export (
57+ $ this ->out ,
58+ ['font ' => __DIR__ . '/../font/dejavu.ttf ' , 'lineNo ' => true ]
59+ );
5760
5861 $ this ->assertFileExists ($ this ->out , 'It should export with given font ' );
5962 // $this->assertSame(\file_get_contents($this->ref), \file_get_contents($this->out));
Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ public function testHighlightCode()
2626 );
2727 }
2828
29+ public function testHighlightCodeWithLineNo ()
30+ {
31+ $ code = (new Highlighter )->highlight ('<?php echo "Hello world!"; ' , ['lineNo ' => true ]);
32+
33+ $ this ->assertContains (
34+ '[2;36;40m1. [0m[0;32;40m<?php [0m[0;31;40mecho [0m[0;33;40m"Hello world!"[0m[0;31;40m;[0m ' ,
35+ $ code
36+ );
37+ }
38+
2939 public function testHighlightFile ()
3040 {
3141 $ code = (string ) Highlighter::for (__DIR__ . '/../example.php ' );
You can’t perform that action at this time.
0 commit comments