Skip to content

Commit

Permalink
[7.3] MethodChainingIndentationFixer - add tests for PHP 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored and keradus committed Jan 4, 2019
1 parent a1cd2cb commit f49510a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
24 changes: 24 additions & 0 deletions tests/Fixer/Whitespace/MethodChainingIndentationFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,28 @@ public function provideWindowsWhitespacesCases()
],
];
}

/**
* @requires PHP 7.3
*/
public function testFix73()
{
$this->doTest(
'<?php
$user->setEmail("voff.web@gmail.com", )
->setPassword("233434" ,)
->setEmailConfirmed(false , )
->setEmailConfirmationCode("123456", );
',
'<?php
$user->setEmail("voff.web@gmail.com", )
->setPassword("233434" ,)
->setEmailConfirmed(false , )
->setEmailConfirmationCode("123456", );
'
);
}
}
9 changes: 7 additions & 2 deletions tests/Fixtures/Integration/misc/PHP7_3.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PHP 7.3 test.
"@Symfony:risky": true,
"list_syntax": {"syntax": "short"},
"mb_str_functions": true,
"method_chaining_indentation": true,
"multiline_whitespace_before_semicolons": true,
"native_function_invocation": {"include": ["get_class"]},
"php_unit_test_case_static_method_calls": {"call_type": "this"},
Expand Down Expand Up @@ -40,9 +41,11 @@ __DIR__; // `dir_constant` rule
null === $var; // `is_null` 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
$this->method1() // `multiline_whitespace_before_semicolons` rule
->method2(3, );
->method2(3, );
mb_strlen($str, ); // `native_function_casing` rule
$c = \get_class($d, ); // `native_function_invocation` rule
$a = rtrim($b, ); // `no_alias_functions` rule
Expand Down Expand Up @@ -85,9 +88,11 @@ dirname(__FILE__, ); // `dir_constant` rule
is_null($var, ); // `is_null` rule
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 = intval($b, ); // `modernize_types_casting` rule
$this->method1() // `multiline_whitespace_before_semicolons` rule
->method2(3, )
->method2(3, )
;
STRLEN($str, ); // `native_function_casing` rule
$c = get_class($d, ); // `native_function_invocation` rule
Expand Down

0 comments on commit f49510a

Please sign in to comment.