Skip to content

Commit

Permalink
Add tests for reason phrase to Response class tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
trevormorse committed Jun 19, 2012
1 parent 6a766ba commit 730e81b
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/frapi/tests/unit-tests/library/Frapi/ResponseTest.php
Expand Up @@ -30,13 +30,13 @@ class Frapi_ResponseTest extends PHPUnit_Framework_TestCase
public function testResponseCode()
{
$response = new Frapi_Response(array('code' => 419));

$this->assertEquals(
419,
$response->getStatusCode()
);
}

/**
* Test that a response code is correctly set within a Frapi_Response
*/
Expand All @@ -49,12 +49,31 @@ public function testResponseData()
)
)
);

$data = $response->getData();

$this->assertEquals(
'success',
$data['test']
);
}

/**
* Test that a reason phrase is correctly set within a Frapi_Response
*/
public function testReasonPhrase()
{
$response = new Frapi_Response(array('reason_phrase' => 'A Reason Phrase'));
$this->assertEquals('A Reason Phrase', $response->getReasonPhrase());
}

/**
* Test that a reason phrase is correctly set with a Frapi_Response by a
* standard http code
*/
public function testReasonPhraseByHttpCode()
{
$response = new Frapi_Response(array('code' => 405));
$this->assertEquals('Method Not Allowed', $response->getReasonPhrase());
}
}

0 comments on commit 730e81b

Please sign in to comment.