Skip to content
Snippets Groups Projects
Unverified Commit 5ce9e73b authored by Daniel Kesselberg's avatar Daniel Kesselberg
Browse files

Add message for DoesNotExistException

parent 72cc8270
No related branches found
No related tags found
No related merge requests found
......@@ -56,8 +56,8 @@ class ChangesCheck {
$version = $this->normalizeVersion($version);
$changesInfo = $this->mapper->getChanges($version);
$changesData = json_decode($changesInfo->getData(), true);
if(empty($changesData)) {
throw new DoesNotExistException();
if (empty($changesData)) {
throw new DoesNotExistException('Unable to decode changes info');
}
return $changesData;
}
......
......@@ -380,4 +380,21 @@ class ChangesCheckTest extends TestCase {
$this->assertTrue(isset($data['whatsNew']['en']['regular']));
$this->assertTrue(isset($data['changelogURL']));
}
public function testGetChangesForVersionEmptyData() {
$entry = $this->createMock(ChangesResult::class);
$entry->expects($this->once())
->method('__call')
->with('getData')
->willReturn('');
$this->mapper->expects($this->once())
->method('getChanges')
->with('13.0.7')
->willReturn($entry);
$this->expectException(DoesNotExistException::class);
/** @noinspection PhpUnhandledExceptionInspection */
$this->checker->getChangesForVersion('13.0.7');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment