ERR_CONNECTION_RESET if I use return value from function in test case
When I run the following test case in simpletest, I get an
ERR_CONNECTION_RESET if I use line B, but everything seems to work if I
use line A.
class TestPredicateRequest extends UnitTestCase
{
function testConstructWithPredicate()
{
Mock::generate("IQueryRequest");
$oRequest = new MockIQueryRequest();
$oPrototype = new QueryPrototype("TEST_COMMAND_STRING",
array(1 =>
QueryTypeConstants::CHARACTER_ID,
2 =>
QueryTypeConstants::CHARACTER_ID),
QueryTypeConstants::BOOLEAN);
$oRequest->returns("GetArguments", array(2 => 102)); //only
argument 2 is set.
$oRequest->returns("GetPrototype", $oPrototype);
$oRequest->returns("GetUnsetArguments", array(1)); //only argument
1 is unset
$oToTest = new CharacterPredicateRequest($oRequest);
$this->Here(101); //LINE A
//$oItem = $this->Here(101); //LINE B
}
function Here($CharacterID)
{
return $CharacterID;
}
}
What possible reason would there be that storing the return value of the
function or not is what controls whether or not an error happens?
No comments:
Post a Comment