diff --git a/tests/Rules/PHPUnit/data/assert-same.php b/tests/Rules/PHPUnit/data/assert-same.php index 48b81e4..41384e5 100644 --- a/tests/Rules/PHPUnit/data/assert-same.php +++ b/tests/Rules/PHPUnit/data/assert-same.php @@ -65,4 +65,18 @@ public function testOther() $foo->assertSame(); } + public function testStaticMethodReturnWithSameTypeIsNotReported() + { + $this->assertSame(self::createSomething('foo'), self::createSomething('foo')); + $this->assertNotSame(self::createSomething('bar'), self::createSomething('bar')); + } + + /** + * @return object + */ + private static function createSomething(string $what) + { + return new \stdClass(); + } + }