Browse Source

add test reproducing #5533

Jeremiasz Major 3 years ago
parent
commit
e3f0d37254
1 changed files with 21 additions and 0 deletions
  1. 21 0
      tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php

+ 21 - 0
tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php

@@ -498,4 +498,25 @@ EOT
             ],
         ];
     }
+
+    /**
+     * @param string $input
+     *
+     * @dataProvider provideDoNotFix80Cases
+     * @requires PHP 8.0
+     */
+    public function test80DoNotFix($input)
+    {
+        $this->doTest($input);
+    }
+
+    public function provideDoNotFix80Cases()
+    {
+        return [
+            ['<?php
+
+function test(#[TestAttribute] ?User $user) {}
+'],
+        ];
+    }
 }