Last active
December 16, 2015 22:19
-
-
Save polyfractal/5506185 to your computer and use it in GitHub Desktop.
Revisions
-
polyfractal revised this gist
May 2, 2013 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,10 @@ public function assertThrowsException($exception, $code) public function testGizmo() { $widget = 'something'; // Some more code $this->assertThrowsException('\Package\Specific\Exception', function () use ($widget) { $blah = new \Package\Gizmo($widget); }); -
polyfractal created this gist
May 2, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ public function assertThrowsException($exception, $code) { $raisedException = null; try { $code(); } catch (\Exception $raisedException) { // No more code, we only want to catch the exception in $raisedException. } $this->assertInstanceOf($exception, $raisedException); } public function testGizmo() { $this->assertThrowsException('\Package\Specific\Exception', function () use ($widget) { $blah = new \Package\Gizmo($widget); }); }