-
Notifications
You must be signed in to change notification settings - Fork 35
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
Controller_Test_Case - ensure PHPUnit invariance #2065
base: master
Are you sure you want to change the base?
Conversation
* | ||
* @var array<string,array{0: string, 1: callable, 2: int}> | ||
*/ | ||
protected array $controller_added_filters = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.WhiteSpace.ScopeIndent.IncorrectExact
Line indented incorrectly; expected 0 tabs, found 1
/** | ||
* Unregisters the original controller and sets up the test case. | ||
* | ||
* @since TBD | ||
* | ||
* @return void | ||
*/ | ||
<<<<<<< Updated upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.PHP.Syntax.PHPSyntax
PHP syntax error: syntax error, unexpected '<<' (T_SL), expecting function (T_FUNCTION) or const (T_CONST)
protected function setUp() { | ||
parent::setUp(); | ||
|
||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.VersionControl.GitMergeConflict.DelimiterFound
Merge conflict boundary found; type: delimiter
protected function setUp() { | ||
parent::setUp(); | ||
|
||
======= | ||
protected function set_up_controller_test_case(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.WhiteSpace.ScopeIndent.IncorrectExact
Line indented incorrectly; expected 0 tabs, found 1
protected function setUp() { | ||
parent::setUp(); | ||
|
||
======= | ||
protected function set_up_controller_test_case(): void { | ||
>>>>>>> Stashed changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.VersionControl.GitMergeConflict.CloserFound
Merge conflict boundary found; type: closer
@@ -255,7 +284,11 @@ | |||
0, | |||
$added_filters, | |||
'The controller should have removed all its filters and actions: ' | |||
<<<<<<< Updated upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 2 tabs, found 0
. PHP_EOL . json_encode( $added_filters, JSON_PRETTY_PRINT ) | ||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.VersionControl.GitMergeConflict.DelimiterFound
Merge conflict boundary found; type: delimiter
. PHP_EOL . json_encode( $added_filters, JSON_PRETTY_PRINT ) | ||
======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 2 tabs, found 0
. PHP_EOL . json_encode( $added_filters, JSON_PRETTY_PRINT ) | ||
======= | ||
. PHP_EOL . wp_json_encode( $this->controller_added_filters, JSON_PRETTY_PRINT ) | ||
>>>>>>> Stashed changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.VersionControl.GitMergeConflict.CloserFound
Merge conflict boundary found; type: closer
. PHP_EOL . json_encode( $added_filters, JSON_PRETTY_PRINT ) | ||
======= | ||
. PHP_EOL . wp_json_encode( $this->controller_added_filters, JSON_PRETTY_PRINT ) | ||
>>>>>>> Stashed changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 2 tabs, found 0
ce282ea
to
d395ff2
Compare
callable $callback, | ||
int $priority = 10, | ||
int $args = 1 | ||
) use ( $controller_class, &$added_filters ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.MultiLineFunctionDeclaration.UseOneParamPerLine
Multi-line use declarations must define one parameter per line
string $tag, | ||
callable $callback, | ||
int $priority = 10 | ||
) use ( $controller_class, &$added_filters ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[phpcs] reported by reviewdog 🐶Squiz.Functions.MultiLineFunctionDeclaration.UseOneParamPerLine
Multi-line use declarations must define one parameter per line
This is a follow-up to the #2062 and the Event Tickets #2977 one.
This fixes an issue where, depending on the PHPUnit version (TEC uses any version between 6 and 10 depending on the project, Codeception and wp-browser version), the set-up and tear-down methods of the
Controller_Test_Case
would not run in consistent order. With this change the code is reasonably isoalated.There are no existing or new tests in Common proper for this change, since it would require a meta PHPunit setup, but I've created test PRs on ET and TEC pulling this Common branch to make sure all works fine: