Browse Source

Handle more priority tests cases

SpacePossum 6 years ago
parent
commit
e50c40bc77

+ 0 - 7
tests/AutoReview/FixerFactoryTest.php

@@ -183,8 +183,6 @@ final class FixerFactoryTest extends TestCase
             [$fixers['phpdoc_order'], $fixers['phpdoc_trim']],
             [$fixers['phpdoc_return_self_reference'], $fixers['no_superfluous_phpdoc_tags']],
             [$fixers['phpdoc_scalar'], $fixers['phpdoc_to_return_type']],
-            [$fixers['phpdoc_separation'], $fixers['phpdoc_trim']],
-            [$fixers['phpdoc_summary'], $fixers['phpdoc_trim']],
             [$fixers['phpdoc_to_comment'], $fixers['no_empty_comment']],
             [$fixers['phpdoc_to_comment'], $fixers['phpdoc_no_useless_inheritdoc']],
             [$fixers['phpdoc_to_return_type'], $fixers['fully_qualified_strict_types']],
@@ -274,18 +272,13 @@ final class FixerFactoryTest extends TestCase
         // This structure contains older cases that are not yet covered by tests.
         // It may only shrink, never add anything to it.
         $casesWithoutTests = [
-            'class_attributes_separation,indentation_type.test',
             'indentation_type,phpdoc_indent.test',
             'method_separation,braces.test',
-            'method_separation,indentation_type.test',
-            'no_empty_statement,no_multiline_whitespace_before_semicolons.test',
             'phpdoc_no_access,phpdoc_order.test',
             'phpdoc_no_access,phpdoc_separation.test',
             'phpdoc_no_package,phpdoc_order.test',
             'phpdoc_order,phpdoc_separation.test',
             'phpdoc_order,phpdoc_trim.test',
-            'phpdoc_separation,phpdoc_trim.test',
-            'phpdoc_summary,phpdoc_trim.test',
         ];
 
         $integrationTestExists = $this->doesIntegrationTestExist($first, $second);

+ 27 - 0
tests/Fixer/Phpdoc/PhpdocSeparationFixerTest.php

@@ -585,4 +585,31 @@ EOF;
 
         $this->doTest($expected, $input);
     }
+
+    public function testWithSpacing()
+    {
+        $expected = '<?php
+    /**
+     * Foo
+     *
+     * @bar 123
+     *
+     * {@inheritdoc}       '.'
+     *
+     *   @param string $expected
+     * @param string $input
+     */';
+
+        $input = '<?php
+    /**
+     * Foo
+     * @bar 123
+     *
+     * {@inheritdoc}       '.'
+     *   @param string $expected
+     * @param string $input
+     */';
+
+        $this->doTest($expected, $input);
+    }
 }

+ 14 - 0
tests/Fixer/Phpdoc/PhpdocSummaryFixerTest.php

@@ -24,6 +24,20 @@ use PhpCsFixer\WhitespacesFixerConfig;
  */
 final class PhpdocSummaryFixerTest extends AbstractFixerTestCase
 {
+    public function testFixWithTrailingSpace()
+    {
+        $expected = '<?php
+/**
+ * Test.
+ */';
+
+        $input = '<?php
+/**
+ * Test         '.'
+ */';
+        $this->doTest($expected, $input);
+    }
+
     public function testFix()
     {
         $expected = <<<'EOF'

+ 23 - 0
tests/Fixtures/Integration/priority/class_attributes_separation,indentation_type.test

@@ -0,0 +1,23 @@
+--TEST--
+Integration of fixers: class_attributes_separation, indentation_type
+--RULESET--
+{"class_attributes_separation": true, "indentation_type": true}
+--EXPECT--
+<?php
+
+class Sample
+{
+    private $a;
+
+    /** second in a hour */
+    private $d;
+}
+
+--INPUT--
+<?php
+
+class Sample
+{	private $a;
+    /** second in a hour */
+    private $d;
+}

+ 21 - 0
tests/Fixtures/Integration/priority/method_separation,indentation_type.test

@@ -0,0 +1,21 @@
+--TEST--
+Integration of fixers: method_separation, indentation_type
+--RULESET--
+{"method_separation": true, "indentation_type": true}
+--EXPECT--
+<?php
+
+class Sample
+{
+    public function lintFile($path){}
+
+    public function lintSource($source){}
+}
+
+--INPUT--
+<?php
+
+class Sample
+{	public function lintFile($path){}
+    public function lintSource($source){}
+}