Make tests fail by default & PSR1 compliance. #13

Closed
wants to merge 5 commits into
from

2 participants

@Stubbs

I've changed the default content to something that will cause the test to be visible in the test results rather than comments which would show as a passing test by default. It's surrounded by a tab stop so a dev can easily land on it & overwrite with their actual test.

I understand this is quite different from the initial implementation but I think it's more robust.

I've also added another tab stop in the tests for a @covers statement and made the methods it produces PSR1 compliant.

@Stubbs Stubbs Changed the default content of tests to be a call to markTestIncomplete.
I've changed the default content to something that will cause the test
to be visible in the test results rather than comments which would show
as a passing test by default.

I understand this is quite different from the initial implementation but
I think it's more robust.

I've also added another tab stop in the tests for a @covers statement
and made the methods it produces PSR1 compliant.
3bf16af
@stuartherbert

I like the idea of making tests fail by default, and the @covers statement. I haven't spotted what you've changed to make it more PSR1-compliant.

I'm not happy with losing the comments inside the test methods, and can't accept the pull request as a result.

@Stubbs

The PSR1 change is just moving the opening curly brace on to the same line as the method definition.

I understand about the comments, what if I made each comment an incomplete test statement, might seem a bit overkill though?

@Stubbs

So, in the process of trying to work out why php-cs-fixer wasn't fixing my code with opening braces on the next line I've been reading PSR1 & 2 and it would appear there is a problem with the sniffs I'm using. PSR2 says the exact opposite, braces MUST be on the next line.

@Stubbs Stubbs Added a new snippets file for small snippets, mostly assertions. Adde…
…d a complete 'expects' snippet with multiple tab stops
eaceb24
@stuartherbert

I've added in:

  • markTestIncomplete() for both snippets
  • @covers tag for both snippets

Will that cover it?

@Stubbs
@Stubbs Stubbs closed this Nov 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment