Skip to content

Commit 1c7340d

Browse files
authored
Add error for missing file (#39)
1 parent 6ba04bb commit 1c7340d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/DiffFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getChangedLines()
2828
!is_readable($this->fileLocation) &&
2929
strpos($this->fileLocation, "php://") !== 0
3030
)) {
31-
throw new InvalidArgumentException("Can't read file");
31+
throw new InvalidArgumentException("Can't read file", 1);
3232
}
3333

3434
$handle = fopen($this->fileLocation, 'r');

tests/DiffFileLoadTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function testDiffResultsMatch($file, $expected)
2222
public function testNonExistantFile()
2323
{
2424
$this->expectException(InvalidArgumentException::class);
25+
$this->expectExceptionCode(1);
2526
$this->getChangedLines('ufhbubfusdf');
2627
}
2728

0 commit comments

Comments
 (0)