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

Added failing unit test for bad HTTP requests. #2031

Closed
wants to merge 3 commits into from
Closed

Added failing unit test for bad HTTP requests. #2031

wants to merge 3 commits into from

Conversation

nickdnk
Copy link
Contributor

@nickdnk nickdnk commented Nov 3, 2016

Hello

As requested I have written a failing unit test to illustrate the issue with an unsupported method used by clients.

Currently this results in a code 500 error on an "out-of-the-box" Slim deployment, which is not ideal.

Issue: #2005

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.199% when pulling 2b6812d on nickdnk:3.x into 2f29cc2 on slimphp:3.x.

@dopesong
Copy link
Contributor

dopesong commented Nov 3, 2016

FILE: /home/travis/build/slimphp/Slim/tests/AppTest.php
----------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
 1985 | WARNING | [ ] Line exceeds 120 characters; contains 134
      |         |     characters
 1986 | WARNING | [ ] Line exceeds 120 characters; contains 121
      |         |     characters
 1988 | ERROR   | [x] Opening brace should be on a new line
 2006 | ERROR   | [x] Function closing brace must go on the next line
      |         |     following the body; found 1 blank lines before
      |         |     brace

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

@nickdnk Can you address the PHPCS issues please?

@nickdnk
Copy link
Contributor Author

nickdnk commented Nov 18, 2016

I'm sorry, but what does that mean? Ian told me to write this test to draw his attention to fixing it. He has an issue open for it, as do I.

Testing is not my strong suit.

Sent from my iPhone

On 18 Nov 2016, at 09.14, Rob Allen <notifications@github.commailto:notifications@github.com> wrote:

@nickdnkhttps://github.com/nickdnk Can you address the PHPCS issues please?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/2031#issuecomment-261473206, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIBYsmfnHUy80tPZW2G1sG-XrI18B9KEks5q_V5QgaJpZM4Ko0lq.

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

@nickdnk If you look in CI section on here, you'll see: "Some checks were not successful".

Opening up, you see that this PR failed the Travis checks. Clicking on "Details" takes you to https://travis-ci.org/slimphp/Slim/builds/173057833.

Pick the 5.6 one, click into it and scroll to the bottom and you'll see what @dopesong posted earlier. This is the list of errors created by phpcs.

Specifically in AppTest.php, there are problems with lines 1988 and 2006.

@nickdnk
Copy link
Contributor Author

nickdnk commented Nov 18, 2016

Aha okay. I'll have a look at that when I can.

This means the actual code is fine but it has to do with new lines, indents and so on, correct?

Sent from my iPhone

On 18 Nov 2016, at 11.48, Rob Allen <notifications@github.commailto:notifications@github.com> wrote:

@nickdnkhttps://github.com/nickdnk If you look in CI section on here, you'll see: "Some checks were not successful".

Opening up, you see that this PR failed the Travis checks. Clicking on "Details" takes you to https://travis-ci.org/slimphp/Slim/builds/173057833.

Pick the 5.6 one, click into it and scroll to the bottom and you'll see what @dopesonghttps://github.com/dopesong posted earlier. This is the list of errors created by phpcs.

Specifically in AppTest.php, there are problems with lines 1988 and 2006.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/2031#issuecomment-261503084, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIBYsnP1B_PJTQ8_NmNZI1Gs2UeD_468ks5q_YJjgaJpZM4Ko0lq.

@nickdnk
Copy link
Contributor Author

nickdnk commented Nov 18, 2016

Aha okay. I'll have a look at that when I can.

This means the actual code is fine but it has to do with new lines, indents and so on, correct?

Sent from my iPhone

On 18 Nov 2016, at 11.48, Rob Allen <notifications@github.commailto:notifications@github.com> wrote:

@nickdnkhttps://github.com/nickdnk If you look in CI section on here, you'll see: "Some checks were not successful".

Opening up, you see that this PR failed the Travis checks. Clicking on "Details" takes you to https://travis-ci.org/slimphp/Slim/builds/173057833.

Pick the 5.6 one, click into it and scroll to the bottom and you'll see what @dopesonghttps://github.com/dopesong posted earlier. This is the list of errors created by phpcs.

Specifically in AppTest.php, there are problems with lines 1988 and 2006.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/2031#issuecomment-261503084, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIBYsnP1B_PJTQ8_NmNZI1Gs2UeD_468ks5q_YJjgaJpZM4Ko0lq.

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

Correct - the PHPCS checks are about the way the code is laid out.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 97.256% when pulling c65dbad on nickdnk:3.x into 2f29cc2 on slimphp:3.x.

@nickdnk
Copy link
Contributor Author

nickdnk commented Nov 18, 2016

I think it's good now, yes?

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

The test is correctly failing, yes :)

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

Now we just need @iansltx or someone else to fix it :)

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

Can you add the annotation to tell PHPUnit to skip this test?

I can then merge it and when @iansltx (or whoever) branches to fix it, they can remove it on their branch.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 97.258% when pulling 265ddc0 on nickdnk:3.x into 2f29cc2 on slimphp:3.x.

@nickdnk
Copy link
Contributor Author

nickdnk commented Nov 18, 2016

Done

@akrabat
Copy link
Member

akrabat commented Nov 18, 2016

Thanks - the CI passes now :)

@nickdnk nickdnk changed the title Added failing method for bad HTTP requests. Added failing unit test for bad HTTP requests. Nov 24, 2016
@akrabat
Copy link
Member

akrabat commented Feb 6, 2017

Fixed as part of #2141

@akrabat akrabat closed this Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants