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

$scenario->skip() does not stop execution of Cept #2576

Closed
Naktibalda opened this issue Nov 24, 2015 · 3 comments
Closed

$scenario->skip() does not stop execution of Cept #2576

Naktibalda opened this issue Nov 24, 2015 · 3 comments

Comments

@Naktibalda
Copy link
Member

<?php 
$I = new FunctionalTester($scenario);
$I->wantTo('skip this test');

$scenario->skip();
sleep('10');

My expectation is that the skip() will be parsed before execution and the test will not be executed.
Changelog of 2.1.1 says Skipped and Incomplete tests won't fire test.before and test.after events.
Do I have to use return after $scenario->skip()?

$scenario->skip();
return;
@DavertMik
Copy link
Member

Actually it should work on parsing:

https://github.com/Codeception/Codeception/blob/2.1/src/Codeception/Lib/Parser.php#L60

I don't know why it doesn't work in your case.

@DavertMik
Copy link
Member

Anyway, I'd rather close this issue, as $scenario->skip is about to be removed in 2.2 and is deprecated now

@Naktibalda
Copy link
Member Author

Update: $scenario->skip() was not removed and it works in a better way now, because it throws exception, so the code below it is not executed.

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

No branches or pull requests

2 participants