Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

test for invalid input #55

Merged
merged 5 commits into from
Sep 15, 2015
Merged

Conversation

Naugrimm
Copy link

@Naugrimm Naugrimm commented Sep 1, 2015

prevent E_NOTICE when passing invalid input to Object::fromBinary - throw Exception instead

@fgrosse
Copy link
Owner

fgrosse commented Sep 12, 2015

Thanks for the contribution Erik :)

Sorry it took so long to review this, I was on vacation and then I got sick :/
I will start the review today

* @expectedExceptionMessage ASN.1 Parser Exception at offset 2: Context-Specific explicitly tagged object [1] starting at offset 2 is shorter than required in the outer tag
* @depends testFromBinary
*/
public function testFromBinaryExTagObjWithInvalidOuterLengthThrowsException2()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its nice you cover all exceptions with a test. I guess you actually wanted to test the longer than allowed part in one of the testFromBinaryExTagObjWithInvalidOuterLengthThrowsException tests?

Otherwise I dont see the difference between them

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. Too much copy/paste :) I will correct that.

@fgrosse fgrosse merged commit c385ba6 into fgrosse:master Sep 15, 2015
fgrosse added a commit that referenced this pull request Sep 15, 2015
Improve exception messages and general error handling

Merges pull request #55 by Naugrimm
@fgrosse
Copy link
Owner

fgrosse commented Sep 15, 2015

Hey Erik, your contribution is available from version 1.4.1
I just applied the style fixes from styleci and renamed two tests in 8455647

Thanks again 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants