-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Meta] Add PHP 7.3 integration test #4184
Conversation
When running the new integration test: with some black magic: --- Expected
+++ Actual
@@ @@
$arg2,
);
__DIR__; // `dir_constant` rule
-dirname($path, 3); // `combine_nested_dirname` rule
-implode('', $pieces, ); // `implode_call` rule
-implode('', $pieces, ); // `implode_call` rule
-null === $var; // `is_null` rule
-$foo->__invoke(1, ); // `magic_method_casing` rule
+dirname(dirname(dirname($path, ), ), ); // `combine_nested_dirname` rule
+implode($pieces, '', ); // `implode_call` rule
+implode($pieces, ); // `implode_call` rule
+null === $var,; // `is_null` rule
+$foo->__INVOKE(1, ); // `magic_method_casing` rule
mb_strpos($a, $b, ); // `mb_str_functions` rule
sample('foo', 'foobarbaz', 'baz', ); // `method_argument_space` rule
$user->setEmail('voff.web@gmail.com', ) // `method_chaining_indentation` rule
- ->setPassword('233434', );
-$a = (int) $b; // `modernize_types_casting` rule
+ ->setPassword('233434', );
+$a = (int) ($b, ); // `modernize_types_casting` rule
$this->method1() // `multiline_whitespace_before_semicolons` rule
- ->method2(3, )
-;
-strlen($str, ); // `native_function_casing` rule
-$c = \get_class($d, ); // `native_function_invocation` rule
+ ->method2(3, );
+mb_strlen($str, ); // `native_function_casing` rule
+$c = get_class($d, ); // `native_function_invocation` rule
$a = rtrim($b, ); // `no_alias_functions` rule
$foo->bar($arg1, $arg2, ); // `no_spaces_inside_parenthesis` rule
$this->assertTrue($a, ); // `php_unit_construct` rule
-$this->assertNan($a, ); // `php_unit_dedicate_assert` rule
+$this->assertTrue(is_nan($a, ), ); // `php_unit_dedicate_assert` rule
final class MyTest extends \PHPUnit_Framework_TestCase
{
public function testFoo(): void
{
- $this->expectException("RuntimeException");
- $this->expectExceptionMessage("Msg");
- $this->expectExceptionCode(123); // `php_unit_expectation` rule
- $this->createMock("Foo", ); // `php_unit_mock` rule
- $this->assertSame(a(), b(), ); // `php_unit_strict` rule
+ $this->setExpectedException('RuntimeException', 'Msg', 123); // `php_unit_expectation` rule
+ $this->getMock('Foo', ); // `php_unit_mock` rule
+ $this->assertEquals(a(), b(), ); // `php_unit_strict` rule
$this->assertSame(1, 2, ); // `php_unit_test_case_static_method_calls` rule
}
}
-$a** 1; // `pow_to_exponentiation` rule
-mt_rand($a, $b, ); // `random_api_migration` rule
-(int) $foo; // `set_type_to_cast` rule
-@trigger_error('Warning.', E_USER_DEPRECATED, ); // `silenced_deprecation_error` rule
-in_array($b, $c, true, ); // `strict_param` rule
+$a ** 1; // `pow_to_exponentiation` rule
+random_int($a, $b, ); // `random_api_migration` rule
+$foo = (int) $foo, ; // `set_type_to_cast` rule
+trigger_error('Warning.', E_USER_DEPRECATED, ); // `silenced_deprecation_error` rule
+in_array($b, $c, ); // `strict_param` rule
foo(null === $a, ); // `yoda_style` rule
// https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes |
5fd465c
to
ce0fb47
Compare
I think |
|
# Conflicts: # tests/Fixtures/Integration/misc/PHP7_3.test
# Conflicts: # tests/Fixtures/Integration/misc/PHP7_3.test
We have PR's for all issues! :)
Please help with reviewing and testing
ref #3697
This PR shows how far we are to be compatible with 7.3.
I went over all our built-in fixers to create integration test of what shall work under 7.3.
I am not currently working on fixing all of them, we shall fix them one by one, same like @SpacePossum already started. If you are willing to help, write you are started working on given Fixer, so we won't end up with multiple ppl fixing same issue
Fixers that deserves extra work & utests:
combine_nested_dirname
[7.3] CombineNestedDirnameFixer - support PHP 7.3 #4193implode_call
[7.3] ImplodeCallFixer - add tests for PHP7.3 #4185is_null
(!!!, this one is crashing withErrors reported during linting after fixing file
) [7.3] IsNullFixer - support PHP 7.3 #4187, IsNullFixer - fix parenthesis not closed #4229, [7.3] IsNullFixer - fix trailing comma #4230magic_method_casing
[7.3] MagicMethodCasingFixer - add tests for PHP 7.3 #4192method_chaining_indentation
[7.3] MethodChainingIndentationFixer - add tests for PHP 7.3 #4199modernize_types_casting
[7.3] ModernizeTypesCastingFixer - support PHP 7.3 #4200multiline_whitespace_before_semicolons
[7.3] MultilineWhitespaceBeforeSemicolonsFixer - add tests for PHP 7.3 #4201native_function_casing
[7.3] NativeFunctionCasingFixerTest - tests for 7.3 #4208native_function_invocation
[7.3] NativeFunctionInvocationFixer - add tests for PHP 7.3 #4194no_unset_on_property
[7.3] NoUnsetOnPropertyFixerTest - tests for 7.3 #4214php_unit_dedicate_assert
[7.3] PhpUnitDedicateAssertFixer - support PHP 7.3 #4211php_unit_expectation
[7.3] PhpUnitExpectationFixer - support PHP 7.3 #4222php_unit_mock
[7.3] PhpUnitMockFixer - add tests for PHP 7.3 #4223php_unit_strict
[7.3] PhpUnitStrictFixerTest - tests for 7.3 #4209pow_to_exponentiation
[7.3] PowToExponentiationFixer - add support for PHP7.3 #4173 and [7.3] PowToExponentiationFixer - adding to PHP7.3 integration test #4198random_api_migration
[7.3] RandomApiMigrationFixerTest - tests for 7.3 #4207set_type_to_cast
(!!!, this one is crashing withErrors reported during linting after fixing file
) [7.3] SetTypeToCastFixer - support PHP 7.3 #4195silenced_deprecation_error
[7.3] ErrorSuppressionFixer - support PHP 7.3 #4202strict_param
[7.3] StrictParamFixer - support PHP 7.3 #4197heredoc_indentation
on 2.14 [7.3] PHP7.3 integration tests #4213- [ ]#4213no_unset_cast
on 2.14Probably, we shall investigate how to do it smartly, rathen than manually patch every single Fixer.
Maybe we shall come back to
manipulator
concept, likeFunctionCallManipulator
to add/remove param, and keep logic about trailing comma in that one place, not in 10 Fixersto be added on 2.14: done #4213