Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Commit

Permalink
Makes createFromException return the result array, and TissueTest use…
Browse files Browse the repository at this point in the history
… createFromException
  • Loading branch information
Julien committed Feb 23, 2016
1 parent ccbca52 commit 979c5b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Tissue.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static function bindUncaughtExceptionHandler()
/**
* Create an issue from an Exception
* @param \Exception $e
* @return array
* @throws ErrorException
*/
public static function createFromException(\Exception $e)
Expand All @@ -57,7 +58,7 @@ public static function createFromException(\Exception $e)
if (method_exists($e, 'getSeverity')) {
$severity = $e->getSeverity();
}
static::create(
return static::create(
$e->getMessage(),
$e->getCode(),
$severity,
Expand Down
9 changes: 1 addition & 8 deletions tests/TissueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,7 @@ public function testValidRequest()
} catch (\ErrorException $e) {

Tissue::setConfigPath(TEST_CONFIG_PATH);
$result = Tissue::create(
$e->getMessage(),
$e->getCode(),
$e->getSeverity(),
$e->getFile(),
$e->getLine(),
$e->getTraceAsString()
);
$result = Tissue::createFromException($e);

static::assertNotNull($result, 'null result received');
static::assertTrue(array_key_exists('duplicate', $result), 'duplicate parameter missing');
Expand Down

0 comments on commit 979c5b0

Please sign in to comment.