Skip to content

Instantly share code, notes, and snippets.

@tareko
Created June 11, 2012 19:15
Show Gist options
  • Save tareko/2912083 to your computer and use it in GitHub Desktop.
Save tareko/2912083 to your computer and use it in GitHub Desktop.
Trying to test a 'false' return
// Here is the function in the test file:
public function testStartUnprocessedWithFailedTradeRequest() {
//TODO: Fix Broken test
$Trades = $this->getMockBuilder('_TradeRequest')
->setMethods(array('send'))
->disableOriginalConstructor()
->getMock();
$this->_TradeRequest->expects($this->any())
->method('send')
->will($this->returnValue(true));
$result = $this->testAction('/trades/startUnprocessed');
debug($result);
}
// Here is the code being tested:
$sendDetails = $this->_TradeRequest->send($tradesDetail['id'], $trade['User'], $tradesDetail['User'], $trade['Shift'], $method);
if ($sendDetails['return'] == true) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment