Skip to content

Commit 5115c2b

Browse files
committed
Updated type descriptions in test for detecting wrong asserts
1 parent c7aef31 commit 5115c2b

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

tests/Rules/PHPUnit/AssertSameMethodDifferentTypesRuleTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,55 @@ public function testRule(): void
2828
{
2929
$this->analyse([__DIR__ . '/data/assert-same.php'], [
3030
[
31-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
31+
'Call to method PHPUnit\Framework\Assert::assertSame() with string and int(1) will always evaluate to false.',
3232
10,
3333
],
3434
[
35-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
35+
'Call to method PHPUnit\Framework\Assert::assertSame() with string and stdClass will always evaluate to false.',
3636
11,
3737
],
3838
[
39-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
39+
'Call to method PHPUnit\Framework\Assert::assertSame() with int(1) and string will always evaluate to false.',
4040
12,
4141
],
4242
[
43-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
43+
'Call to method PHPUnit\Framework\Assert::assertSame() with string and int will always evaluate to false.',
4444
13,
4545
],
4646
[
47-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
47+
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0)|int(1), string> and array<int(0)|int(1), int(1)|int(2)> will always evaluate to false.',
4848
14,
4949
],
5050
[
51-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
51+
'Call to method PHPUnit\Framework\Assert::assertSame() with array<string> and array<int> will always evaluate to false.',
5252
39,
5353
],
5454
[
55-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to true.',
55+
'Call to method PHPUnit\Framework\Assert::assertSame() with int(1) and int(1) will always evaluate to true.',
5656
44,
5757
],
5858
[
59-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
59+
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0), string> and array<int(0)|int(1), string> will always evaluate to false.',
6060
45,
6161
],
6262
[
63-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to true.',
63+
'Call to method PHPUnit\Framework\Assert::assertSame() with string and string will always evaluate to true.',
6464
46,
6565
],
6666
[
67-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
67+
'Call to method PHPUnit\Framework\Assert::assertSame() with string and string will always evaluate to false.',
6868
47,
6969
],
7070
[
71-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to true.',
71+
'Call to method PHPUnit\Framework\Assert::assertSame() with stdClass and stdClass will always evaluate to true.',
7272
48,
7373
],
7474
[
75-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
75+
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0), string> and array<int(0)|int(1), int(1)|string> will always evaluate to false.',
7676
51,
7777
],
7878
[
79-
'Call to method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
79+
'Call to method PHPUnit\Framework\Assert::assertSame() with array<int(0)|int(1)|int(2), float(3.000000)|int(2)|string> and array<int(0)|int(1), int(1)|string> will always evaluate to false.',
8080
52,
8181
],
8282
]);

tests/Rules/PHPUnit/AssertSameStaticMethodDifferentTypesRuleTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ public function testRule(): void
2828
{
2929
$this->analyse([__DIR__ . '/data/assert-same.php'], [
3030
[
31-
'Call to static method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
31+
'Call to static method PHPUnit\Framework\Assert::assertSame() with string and int(2) will always evaluate to false.',
3232
16,
3333
],
3434
[
35-
'Call to static method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
35+
'Call to static method PHPUnit\Framework\Assert::assertSame() with string and int(2) will always evaluate to false.',
3636
17,
3737
],
3838
[
39-
'Call to static method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
39+
'Call to static method PHPUnit\Framework\Assert::assertSame() with string and int(2) will always evaluate to false.',
4040
18,
4141
],
4242
[
43-
'Call to static method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
43+
'Call to static method PHPUnit\Framework\Assert::assertSame() with int(1) and int(2) will always evaluate to false.',
4444
53,
4545
],
4646
[
47-
'Call to static method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
47+
'Call to static method PHPUnit\Framework\Assert::assertSame() with int(1) and int(2) will always evaluate to false.',
4848
54,
4949
],
5050
[
51-
'Call to static method PHPUnit\Framework\Assert::assertSame() will always evaluate to false.',
51+
'Call to static method PHPUnit\Framework\Assert::assertSame() with int(1) and int(2) will always evaluate to false.',
5252
55,
5353
],
5454
]);

0 commit comments

Comments
 (0)