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

DX: make integration tests matching entries in FixerFactoryTest #5564

Merged
merged 1 commit into from
Apr 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/AutoReview/FixerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function testPriorityIntegrationTestFilesAreListedPriorityCases($fileName
$fixerName2 = $matches[2];

static::assertTrue(
isset($priorityCases[$fixerName1][$fixerName2]) || isset($priorityCases[$fixerName2][$fixerName1]),
isset($priorityCases[$fixerName1][$fixerName2]),
sprintf('Missing priority test entry for file "%s".', $fileName)
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: binary_operator_spaces,array_indentation.
Integration of fixers: array_indentation,binary_operator_spaces.
--RULESET--
{"binary_operator_spaces": {"default": "align_single_space"}, "array_indentation": true}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: array_indentation,braces.
Copy link
Member

Choose a reason for hiding this comment

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

👎
the idea was that order of rules in file name should be alphabetical, to ease searching

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really? I would never have guessed, and counting the number of tests having not alphabetical order - which is 11 - it looks like you are the only one knowing that 😉

Anyway, what would that ease searching for? I have spotted this when working at #5563 - I've added test file single_space_after_construct,braces.test and saw it's right after the single_import_per_statement ones, so I've added the entry in tests/AutoReview/FixerFactoryTest.php right after the single_import_per_statement ones, and got not nice error as there is an entry with single_line_throw fixer.

Copy link
Member

Choose a reason for hiding this comment

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

i don't mind which way we would go, but lets make it explicit - either always alphabetical, either in order of execution.
if we allow for both, we can end up with 2 files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change in tests/AutoReview/FixerFactoryTest.php solves exactly that concern.

Integration of fixers: braces,array_indentation.
--RULESET--
{"array_indentation": true, "braces": true}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: no_mixed_echo_print,echo_tag_syntax.
Integration of fixers: echo_tag_syntax,no_mixed_echo_print.
--RULESET--
{"no_mixed_echo_print": {"use":"print"}, "echo_tag_syntax": {"format":"long"}}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: no_mixed_echo_print,no_short_echo_tag.
Integration of fixers: no_short_echo_tag,no_mixed_echo_print.
--RULESET--
{"no_mixed_echo_print": {"use":"print"}, "no_short_echo_tag": true}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: no_trailing_whitespace,no_unneeded_control_parentheses.
Integration of fixers: no_unneeded_control_parentheses,no_trailing_whitespace.
--RULESET--
{"no_trailing_whitespace": true, "no_unneeded_control_parentheses": true}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: no_empty_phpdoc,phpdoc_add_missing_param_annotation.
Integration of fixers: phpdoc_add_missing_param_annotation,no_empty_phpdoc.
--RULESET--
{"no_empty_phpdoc": true, "phpdoc_add_missing_param_annotation": true}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: phpdoc_to_return_type,phpdoc_scalar.
Integration of fixers: phpdoc_scalar,phpdoc_to_return_type.
--RULESET--
{"phpdoc_to_return_type": {"scalar_types": true}, "phpdoc_scalar": true}
--REQUIREMENTS--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: fully_qualified_strict_types,phpdoc_to_return_type.
Integration of fixers: phpdoc_to_return_type,fully_qualified_strict_types.
--RULESET--
{"fully_qualified_strict_types": true, "phpdoc_to_return_type": true}
--REQUIREMENTS--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: return_type_declaration,phpdoc_to_return_type.
Integration of fixers: phpdoc_to_return_type,return_type_declaration.
--RULESET--
{"return_type_declaration": {"space_before": "one"}, "phpdoc_to_return_type": true}
--REQUIREMENTS--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: concat_space,single_line_throw.
Integration of fixers: single_line_throw,concat_space.
--RULESET--
{"concat_space": {"spacing": "none"}, "single_line_throw": true}
--EXPECT--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Integration of fixers: increment_style,standardize_increment.
Integration of fixers: standardize_increment,increment_style.
--RULESET--
{"increment_style": {"style": "post"}, "standardize_increment": true}
--EXPECT--
Expand Down