Skip to content

Commit 0f82d7f

Browse files
authored
[Test] Add more test fixture for downgrade named argument with trailing comma (#287)
* [Test] Add more test fixture for downgrade named argumetn with trailing comma * extract multiple fixture * more
1 parent 93b1aff commit 0f82d7f

File tree

4 files changed

+110
-7
lines changed

4 files changed

+110
-7
lines changed

tests/Set/Fixture/named_argument_trailing_comma.php.inc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ final class NamedArgumentTrailingComma
1313
foo: 'foo',
1414
bar: 'bar',
1515
);
16-
17-
$this->run(
18-
bar: 'bar',
19-
foo: 'foo',
20-
);
2116
}
2217
}
2318

@@ -35,8 +30,6 @@ final class NamedArgumentTrailingComma
3530
public function execute()
3631
{
3732
$this->run('foo', 'bar');
38-
39-
$this->run('foo', 'bar');
4033
}
4134
}
4235

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace Rector\Tests\Set\Fixture;
4+
5+
final class NamedArgumentTrailingComma2
6+
{
7+
public function run(string $foo, string $bar)
8+
{}
9+
10+
public function execute()
11+
{
12+
$this->run(
13+
bar: 'bar',
14+
foo: 'foo',
15+
);
16+
}
17+
}
18+
19+
?>
20+
-----
21+
<?php
22+
23+
namespace Rector\Tests\Set\Fixture;
24+
25+
final class NamedArgumentTrailingComma2
26+
{
27+
public function run(string $foo, string $bar)
28+
{}
29+
30+
public function execute()
31+
{
32+
$this->run('foo', 'bar');
33+
}
34+
}
35+
36+
?>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Rector\Tests\Set\Fixture;
4+
5+
final class NamedArgumentTrailingComma3
6+
{
7+
public function run(string $foo, string $bar, string $baz)
8+
{}
9+
10+
public function execute()
11+
{
12+
$this->run(
13+
bar: 'bar',
14+
baz: 'baz',
15+
foo: 'foo',
16+
);
17+
}
18+
}
19+
20+
?>
21+
-----
22+
<?php
23+
24+
namespace Rector\Tests\Set\Fixture;
25+
26+
final class NamedArgumentTrailingComma3
27+
{
28+
public function run(string $foo, string $bar, string $baz)
29+
{}
30+
31+
public function execute()
32+
{
33+
$this->run('foo', 'bar', 'baz');
34+
}
35+
}
36+
37+
?>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Rector\Tests\Set\Fixture;
4+
5+
final class NamedArgumentTrailingComma4
6+
{
7+
public function run(string $foo, string $bar, string $baz)
8+
{}
9+
10+
public function execute()
11+
{
12+
$this->run(
13+
baz: 'baz',
14+
foo: 'foo',
15+
bar: 'bar',
16+
);
17+
}
18+
}
19+
20+
?>
21+
-----
22+
<?php
23+
24+
namespace Rector\Tests\Set\Fixture;
25+
26+
final class NamedArgumentTrailingComma4
27+
{
28+
public function run(string $foo, string $bar, string $baz)
29+
{}
30+
31+
public function execute()
32+
{
33+
$this->run('foo', 'bar', 'baz');
34+
}
35+
}
36+
37+
?>

0 commit comments

Comments
 (0)