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

Fail if there is no assert in test #112

Closed
janmarek opened this issue Mar 23, 2014 · 3 comments
Closed

Fail if there is no assert in test #112

janmarek opened this issue Mar 23, 2014 · 3 comments

Comments

@janmarek
Copy link
Contributor

I wrote my first test with TestCase and I forgot to run the test case ( (new SomethingTestCase())->run(); ). This might be common mistake for former PHPUnit users.

Tester said that there was 1 passed test.

I thing that error or at least warning would be better if there is no assert in test.

@milo
Copy link
Member

milo commented Mar 23, 2014

Related to #32.

If you annotate test file by @testCase you get hint.

@milo milo mentioned this issue Mar 30, 2014
2 tasks
@fprochazka
Copy link
Contributor

@milo when you define the testcase, you usually have to include autoloader and run Tester\Environment::setup();, so there could be some shutdown handler, that would check if there are loaded non-abstract testcase classes and at least one was ran. There could be some private static counter on the testcase class that the handler would check and report if the run call is missing.

@milo
Copy link
Member

milo commented Mar 30, 2014

@fprochazka Jop. We were discuss with @dg something similar (as here). I'll send PR during the week.

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

No branches or pull requests

3 participants