We're going to throw an exception right away here, but this is still
problematic because of PHPUnit:
"By default, PHPUnit converts PHP errors, warnings, and notices that
are triggered during the execution of a test to an exception."
http://phpunit.de/manual/4.2/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.errors
Also change the exception message to something saner.
Change-Id: I766c36076d34428035be78bbb3cf36cc572b565b
$session = $wgRequest->getSessionArray();
}
- if ( $session['wsToken'] ) {
+ if ( isset( $session['wsToken'] ) && $session['wsToken'] ) {
// add edit token to fake session
$session['wsEditToken'] = $session['wsToken'];
// add token to request parameters
return $this->doApiRequest( $params, $session, false, $user );
} else {
- throw new Exception( "request data not in right format" );
+ throw new Exception( "Session token not available" );
}
}