Skip to content

Commit

Permalink
GH-Issue #13 : Added support for a "verbose" flag that adds HTTP requ…
Browse files Browse the repository at this point in the history
…est/response if to test output
  • Loading branch information
enygma committed Oct 27, 2010
1 parent f35ad84 commit 54cc451
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Action/ActionGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public function execute()
$httpReturn = $http->send();
HelperSession::execute($httpReturn->getHeaders());

$msgObj::setData('__lastRequest',$http->getRawRequestMessage());
$msgObj::setData('__lastResponse',$http->getRawResponseMessage());

$msgObj::setData('currentHttp',$httpReturn);
return $httpReturn;
}catch(Exception $e){
Expand Down
3 changes: 3 additions & 0 deletions lib/Action/ActionPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public function execute()
$httpReturn = $http->send();
HelperSession::execute($httpReturn->getHeaders());

$msgObj::setData('__lastRequest',$http->getRawRequestMessage());
$msgObj::setData('__lastResponse',$http->getRawResponseMessage());

$msgObj::setData('currentHttp',$httpReturn);
return $httpReturn;
}catch(HttpException $e){
Expand Down
8 changes: 7 additions & 1 deletion lib/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ public function __call($name,$arg)
$returnObj = $actionObj->execute();

$this->testStatus[$testName][$actionName]=array('pass','');

if(HelperArguments::getArgument('verbose')){
array_push($this->testStatus[$testName][$actionName],
$currentMessage::getData('__lastRequest'),
$currentMessage::getData('__lastResponse')
);
};
}catch(Exception $e){
//echo 'ERROR on '.$actionName.': '.$e->getMessage();
$this->testStatus[$testName][$actionName]=array('fail',$e->getMessage());
}
// return thyself!
Expand Down

0 comments on commit 54cc451

Please sign in to comment.