Skip to content

Commit 0fcf821

Browse files
herndlmondrejmirtes
authored andcommitted
Add assertSame test case with static method
1 parent b5cc290 commit 0fcf821

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: tests/Rules/PHPUnit/data/assert-same.php

+13
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,17 @@ public function testOther()
6565
$foo->assertSame();
6666
}
6767

68+
public function testStaticMethodReturnWithSameTypeIsNotReported()
69+
{
70+
$this->assertSame(self::createSomething('foo'), self::createSomething('foo'));
71+
}
72+
73+
/**
74+
* @return object
75+
*/
76+
private static function createSomething(string $what)
77+
{
78+
return new \stdClass();
79+
}
80+
6881
}

0 commit comments

Comments
 (0)