Browse Source

[7.3] MagicMethodCasingFixer - add tests for PHP 7.3

Kuba Werłos 6 years ago
parent
commit
cc86f81d34

+ 11 - 0
tests/Fixer/Casing/MagicMethodCasingFixerTest.php

@@ -312,4 +312,15 @@ function __Tostring() {}',
             '
         );
     }
+
+    /**
+     * @requires PHP 7.3
+     */
+    public function testFix73()
+    {
+        $this->doTest(
+            '<?php $foo->__invoke(1, );',
+            '<?php $foo->__INVOKE(1, );'
+        );
+    }
 }

+ 2 - 0
tests/Fixtures/Integration/misc/PHP7_3.test

@@ -37,6 +37,7 @@ foo(
     $arg2,
 );
 __DIR__; // `dir_constant` rule
+$foo->__invoke(1, ); // `magic_method_casing` rule
 implode('', $pieces, ); // `implode_call` rule
 implode('', $pieces, ); // `implode_call` rule
 mb_strpos($a, $b, ); // `mb_str_functions` rule
@@ -75,6 +76,7 @@ foo(
     $arg2,
 );
 dirname(__FILE__, ); // `dir_constant` rule
+$foo->__INVOKE(1, ); // `magic_method_casing` rule
 implode($pieces, '', ); // `implode_call` rule
 implode($pieces, ); // `implode_call` rule
 strpos($a, $b, ); // `mb_str_functions` rule