-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jared King
committed
Dec 29, 2015
1 parent
f103fb1
commit f33efc9
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Pulsar\Exception; | ||
|
||
use Exception; | ||
|
||
class DriverException | ||
{ | ||
/** | ||
* @var Exception | ||
*/ | ||
private $exception; | ||
|
||
/** | ||
* Sets the underlying exception. | ||
* | ||
* @param Exception $e | ||
*/ | ||
public function setException(Exception $e) | ||
{ | ||
$this->exception = $e; | ||
} | ||
|
||
/** | ||
* Gets the underlying exception. | ||
* | ||
* @return Exception | ||
*/ | ||
public function getException() | ||
{ | ||
return $this->exception; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* @author Jared King <j@jaredtking.com> | ||
* | ||
* @link http://jaredtking.com | ||
* | ||
* @copyright 2015 Jared King | ||
* @license MIT | ||
*/ | ||
namespace Pulsar\Exception; | ||
|
||
use Exception; | ||
|
||
class NotFoundException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
use Pulsar\Exception\DriverException; | ||
|
||
class DriverExceptionTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testException() | ||
{ | ||
$e = new Exception(); | ||
$ex = new DriverException(); | ||
$ex->setException($e); | ||
$this->assertEquals($e, $ex->getException()); | ||
} | ||
} |