Skip to content

Commit b62de49

Browse files
committed
Cleanup
1 parent d0d1d68 commit b62de49

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/Fixer/PhpUnitDedicatedAssertFixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function fix(\SplFileInfo $file, Tokens $tokens): void
9595
private function fixAssertions(Tokens $tokens, int $startIndex, int $endIndex): void
9696
{
9797
for ($index = $startIndex; $index < $endIndex; $index++) {
98-
if (!self::isAssertionCall($tokens, $index)) {
98+
if (!self::isAssertionToFix($tokens, $index)) {
9999
continue;
100100
}
101101

@@ -108,7 +108,7 @@ private function fixAssertions(Tokens $tokens, int $startIndex, int $endIndex):
108108
}
109109
}
110110

111-
private static function isAssertionCall(Tokens $tokens, int $index): bool
111+
private static function isAssertionToFix(Tokens $tokens, int $index): bool
112112
{
113113
static $assertions;
114114

tests/Fixer/PhpUnitAssertArgumentsOrderFixerTest.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,50 +59,50 @@ public function testFoo() {
5959
private static function getFixCases(): iterable
6060
{
6161
yield ['$notThis->assertSame($x, 1);'];
62-
yield ['$this->assertSame;'];
63-
yield ['$this->assertSame();'];
64-
yield ['$this->assertSame(1);'];
65-
yield ['$this->assertSame(1, 2);'];
62+
yield ['self::assertSame;'];
63+
yield ['self::assertSame();'];
64+
yield ['self::assertSame(1);'];
65+
yield ['self::assertSame(1, 2);'];
6666

6767
yield [
6868
'$this->assertSame(1, $x);',
6969
'$this->assertSame($x, 1);',
7070
];
7171

7272
yield [
73-
'$this->assertSame(true, $x);',
74-
'$this->assertSame($x, true);',
73+
'static::assertSame(true, $x);',
74+
'static::assertSame($x, true);',
7575
];
7676

7777
yield [
78-
'$this->assertSame([1, 2, 3], $x);',
79-
'$this->assertSame($x, [1, 2, 3]);',
78+
'self::assertSame([1, 2, 3], $x);',
79+
'self::assertSame($x, [1, 2, 3]);',
8080
];
8181

8282
yield [
83-
'$this->assertSame(array(1, 2, 3), $x);',
84-
'$this->assertSame($x, array(1, 2, 3));',
83+
'self::assertSame(array(1, 2, 3), $x);',
84+
'self::assertSame($x, array(1, 2, 3));',
8585
];
8686

8787
yield [
88-
'$this->assertSame(
88+
'self::assertSame(
8989
false,
9090
$x
9191
);',
92-
'$this->assertSame(
92+
'self::assertSame(
9393
$x,
9494
false
9595
);',
9696
];
9797

9898
yield [
99-
'$this->assertSame(6, foo(1, 2, 3));',
100-
'$this->assertSame(foo(1, 2, 3), 6);',
99+
'self::assertSame(6, foo(1, 2, 3));',
100+
'self::assertSame(foo(1, 2, 3), 6);',
101101
];
102102

103103
yield [
104-
'$this->assertSame(1, $x, "Message");',
105-
'$this->assertSame($x, 1, "Message");',
104+
'self::assertSame(1, $x, "Message");',
105+
'self::assertSame($x, 1, "Message");',
106106
];
107107

108108
yield [
@@ -112,14 +112,14 @@ private static function getFixCases(): iterable
112112

113113
yield [
114114
'
115-
$this->assertSame(1, $a);
116-
$this->assertSame(2, $b);
117-
$this->assertSame(3, $c);
115+
self::assertSame(1, $a);
116+
self::assertSame(2, $b);
117+
self::assertSame(3, $c);
118118
',
119119
'
120-
$this->assertSame($a, 1);
121-
$this->assertSame(2, $b);
122-
$this->assertSame($c, 3);
120+
self::assertSame($a, 1);
121+
self::assertSame(2, $b);
122+
self::assertSame($c, 3);
123123
',
124124
];
125125
}

0 commit comments

Comments
 (0)