Skip to content

Commit 7862c47

Browse files
committed
add unit tests for getSelectedBounds method
1 parent 8157f36 commit 7862c47

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/CodeSnippetTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,15 @@ public function it_returns_the_line_numbers()
183183
$this->assertCount(8, $snippet->getLineNumbers());
184184
$this->assertMatchesSnapshot($snippet->getLineNumbers());
185185
}
186+
187+
/** @test */
188+
public function it_returns_the_selected_bounds()
189+
{
190+
$snippet = (new CodeSnippet())
191+
->surroundingLines(10, 12)
192+
->snippetLineCount(8)
193+
->fromFile($this->testsPath('data/file3.php'));
194+
195+
$this->assertEquals([10, 11, 12], range($snippet->getSelectedBounds()->start, $snippet->getSelectedBounds()->end));
196+
}
186197
}

0 commit comments

Comments
 (0)