Skip to content

Commit 2f5650e

Browse files
committed
add unit tests for getLineNumbers method
1 parent c26360f commit 2f5650e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/CodeSnippetTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,16 @@ public function it_returns_a_string_when_the_snippet_is_cast_to_a_string()
171171

172172
$this->assertMatchesSnapshot((string)$snippet);
173173
}
174+
175+
/** @test */
176+
public function it_returns_the_line_numbers()
177+
{
178+
$snippet = (new CodeSnippet())
179+
->surroundingLines(10, 12)
180+
->snippetLineCount(8)
181+
->fromFile($this->testsPath('data/file3.php'));
182+
183+
$this->assertCount(8, $snippet->getLineNumbers());
184+
$this->assertMatchesSnapshot($snippet->getLineNumbers());
185+
}
174186
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- 7
2+
- 8
3+
- 9
4+
- 10
5+
- 11
6+
- 12
7+
- 13
8+
- 14

0 commit comments

Comments
 (0)