Skip to content
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

Fails to convert laminas to psr when aminas content is null #2

Merged
merged 3 commits into from
Jan 24, 2020

Conversation

svycka
Copy link
Contributor

@svycka svycka commented Jan 24, 2020

@Xerkus said that laminas request can be null and he is right when writing tests I somehow got null end this errored about null written to a stream

@Xerkus Xerkus added the Bug Something isn't working label Jan 24, 2020
@Xerkus Xerkus added this to the 1.2.1 milestone Jan 24, 2020
@Xerkus Xerkus self-assigned this Jan 24, 2020
$laminasRequest->setContent(null);

$psr7Request = Psr7ServerRequest::fromLaminas($laminasRequest);
$this->assertEmpty($psr7Request->getBody()->getContents());
Copy link
Member

Choose a reason for hiding this comment

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

The only thing I could note here is "strict type comparison" - maybe better will be use assertSame('' or assertNull( ?

Copy link
Member

Choose a reason for hiding this comment

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

Strictness does not matter here. Assertion could have been omitted entirely and counter incremented manually as real assertion here is simply a lack of error.

@Xerkus Xerkus merged commit ae92306 into laminas:master Jan 24, 2020
@Xerkus
Copy link
Member

Xerkus commented Jan 24, 2020

@svycka thank you

Xerkus added a commit that referenced this pull request Jan 24, 2020
@svycka svycka deleted the patch-1 branch January 24, 2020 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants