Skip to content
Browse files

[GData] Test exceptions re-worked

  • Loading branch information...
1 parent 0a4821d commit 74e12aa9dde1489f89ec369b349bd65d8faf8d3d @Maks3w committed May 15, 2012
Showing with 6 additions and 21 deletions.
  1. +6 −21 tests/Zend/GData/AppTest.php
View
27 tests/Zend/GData/AppTest.php
@@ -107,35 +107,20 @@ public function testDefaultProtocolVersionIs1X()
public function testMajorProtocolVersionCannotBeLessThanOne()
{
- $exceptionCaught = false;
- try {
- $this->service->setMajorProtocolVersion(0);
- } catch (App\InvalidArgumentException $e) {
- $exceptionCaught = true;
- }
- $this->assertTrue($exceptionCaught, 'Expected exception not caught: Zend_GData_App_InvalidArgumentException');
+ $this->setExpectedException('\Zend\GData\App\InvalidArgumentException');
+ $this->service->setMajorProtocolVersion(0);
}
public function testMajorProtocolVersionCannotBeNull()
{
- $exceptionCaught = false;
- try {
- $this->service->setMajorProtocolVersion(null);
- } catch (App\InvalidArgumentException $e) {
- $exceptionCaught = true;
- }
- $this->assertTrue($exceptionCaught, 'Expected exception not caught: Zend_GData_App_InvalidArgumentException');
+ $this->setExpectedException('\Zend\GData\App\InvalidArgumentException');
+ $this->service->setMajorProtocolVersion(null);
}
public function testMinorProtocolVersionCannotBeLessThanZero()
{
- $exceptionCaught = false;
- try {
- $this->service->setMinorProtocolVersion(-1);
- } catch (App\InvalidArgumentException $e) {
- $exceptionCaught = true;
- }
- $this->assertTrue($exceptionCaught, 'Expected exception not caught: Zend_GData_App_InvalidArgumentException');
+ $this->setExpectedException('\Zend\GData\App\InvalidArgumentException');
+ $this->service->setMinorProtocolVersion(-1);
}
public function testNoGDataVersionHeaderSentWhenUsingV1()

0 comments on commit 74e12aa

Please sign in to comment.
Something went wrong with that request. Please try again.