Skip to content

Commit 19afb8d

Browse files
committed
test: line nos
1 parent 2655e21 commit 19afb8d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/ExporterTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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));

tests/HighlighterTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
'1. <?php echo "Hello world!";',
35+
$code
36+
);
37+
}
38+
2939
public function testHighlightFile()
3040
{
3141
$code = (string) Highlighter::for(__DIR__ . '/../example.php');

0 commit comments

Comments
 (0)