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

[WIP] Start using assert() and not fail() #5063

Merged
merged 2 commits into from
Jul 10, 2018

Conversation

johannesschobel
Copy link
Contributor

This PR changes the Laravel5 module in order to use assert() rather than fail() to indicate if something worked / did not work..
Note that this PR is "work in progress"..

if ($currentNum != $expectedNum) {
$this->fail("The number of found $table ($currentNum) does not match expected number $expectedNum with " . json_encode($attributes));
}
$this->assertEquals($expectedNum, $currentNum,

Choose a reason for hiding this comment

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

  • Opening parenthesis of a multi-line function call must be the last content on the line
  • Only one argument is allowed per line in a multi-line function call

$this->fail("The number of found $table ($currentNum) does not match expected number $expectedNum with " . json_encode($attributes));
}
$this->assertEquals($expectedNum, $currentNum,
"The number of found $table ($currentNum) does not match expected number $expectedNum with " . json_encode($attributes));

Choose a reason for hiding this comment

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

  • Multi-line function call not indented correctly; expected 12 spaces but found 16
  • Closing parenthesis of a multi-line function call must be on a line by itself

if ($currentNum != $expectedNum) {
$this->fail("The number of found records ($currentNum) does not match expected number $expectedNum in table $table with " . json_encode($attributes));
}
$this->assertEquals($expectedNum, $currentNum,

Choose a reason for hiding this comment

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

  • Opening parenthesis of a multi-line function call must be the last content on the line
  • Only one argument is allowed per line in a multi-line function call

$this->fail("The number of found records ($currentNum) does not match expected number $expectedNum in table $table with " . json_encode($attributes));
}
$this->assertEquals($expectedNum, $currentNum,
"The number of found records ($currentNum) does not match expected number $expectedNum in table $table with " . json_encode($attributes));

Choose a reason for hiding this comment

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

  • Multi-line function call not indented correctly; expected 12 spaces but found 16
  • Closing parenthesis of a multi-line function call must be on a line by itself

@DavertMik
Copy link
Member

Thanks

@DavertMik DavertMik merged commit 37fb9c6 into Codeception:2.4 Jul 10, 2018
@johannesschobel
Copy link
Contributor Author

haha, this PR was "work in progress".. i would have added additional asserts.. 😆
anyway, thanks for merging ;)

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.

3 participants