Created
October 16, 2014 04:15
-
-
Save glennpratt/51cece2e677c6685a402 to your computer and use it in GitHub Desktop.
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 characters
<?php | |
function testThrows() { | |
$this->assertThrows(function() { | |
// throw new \Exception('BAH!'); | |
}, 'Exception', "/BAH/"); | |
} | |
function testThrowsA() { | |
$this->assertThrows(function() { | |
throw new \RuntimeException('BAH!'); | |
}, 'InvalidArgumentException'); | |
} | |
function testThrowsB() { | |
$this->assertThrows(function() { | |
throw new \Exception('BAH!'); | |
}, 'Exception', "/DOES NOT MATCH/"); | |
} | |
function testThrowsC() { | |
$this->assertThrows(function() { | |
throw new \Exception('BAH!'); | |
}, 'Exception', "/BAH/"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment