-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More tweaks to match the spec #11
Conversation
Merge pull request #9 from bladeSk/master
Better exception handling in tests (use error code instead of http code) Test for invalid message types
Default limit and order test for message history Tests for messages - decryption with mismatched params, request count on publishing an array of msgs, too large message Removed no longer necessary AblyEncryptionException
Changed hostTimeout to match the spec
Can you rebase this on top of master? We don't need the merge commit in there. |
$msg->data = 81403; | ||
|
||
$this->setExpectedException( 'Ably\Exceptions\AblyException', '', 40003 ); | ||
$channel->publish( $msg ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this test still pass if this line wasn't throwing an exception but others did?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, you're right! Thanks for pointing that out.
Explicit string casts in ChannelHistoryTest.php Refactored ErrorInfo and AblyException
|
||
$this->ablyCode = $ablyCode; | ||
public function __construct( $message, $code = 40000, $statusCode = 400 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need to specify a default code
and statusCode
.
Java needs all three (message + code + statusCode) to be present https://github.com/ably/ably-java/blob/master/src/io/ably/types/AblyException.java#L37 and Ruby uses nil
by default.
If you can use null
here as the default it would be nice.
Looks good to me. 👍 |
Nice work, 👍 |
The code should now fully conform to the spec, just a few more tests are needed