Browse Source

Merge branch '2.2' into 2.8

Dariusz Ruminski 7 years ago
parent
commit
86f060180d
2 changed files with 30 additions and 6 deletions
  1. 1 1
      src/Fixer/Phpdoc/PhpdocTrimFixer.php
  2. 29 5
      tests/Fixer/Phpdoc/PhpdocTrimFixerTest.php

+ 1 - 1
src/Fixer/Phpdoc/PhpdocTrimFixer.php

@@ -122,7 +122,7 @@ final class Foo {}
                     \R[ \t]*(?:\*[ \t]*)?    # lines without useful content
                 )+
                 (\R[ \t]*\*/$)               # DocComment end
-            ~x',
+            ~xu',
             '$1$2',
             $content
         );

+ 29 - 5
tests/Fixer/Phpdoc/PhpdocTrimFixerTest.php

@@ -23,19 +23,43 @@ use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
  */
 final class PhpdocTrimFixerTest extends AbstractFixerTestCase
 {
-    public function testFix()
+    /**
+     * @param string      $expected
+     * @param null|string $input
+     *
+     * @dataProvider provideFixCases
+     */
+    public function testFix($expected, $input = null)
     {
-        $expected = <<<'EOF'
-<?php
+        $this->doTest($expected, $input);
+    }
+
+    public function provideFixCases()
+    {
+        return [
+            [
+<<<'EOF'
+                <?php
     /**
      * @param EngineInterface $templating
      *
      * @return void
      */
 
-EOF;
+EOF
+            ],
+            [
+                '<?php
 
-        $this->doTest($expected);
+/**
+ * @return int количество деактивированных
+ */
+function deactivateCompleted()
+{
+    return 0;
+}',
+            ],
+        ];
     }
 
     public function testFixMore()