Browse Source

DX: add missing priority tests

Kuba Werłos 5 years ago
parent
commit
81512e2445

+ 0 - 4
tests/AutoReview/FixerFactoryTest.php

@@ -290,12 +290,8 @@ final class FixerFactoryTest extends TestCase
         // It may only shrink, never add anything to it.
         $casesWithoutTests = [
             'indentation_type,phpdoc_indent.test',
-            'method_separation,braces.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',
         ];
 
         $integrationTestName = $this->generateIntegrationTestName($first, $second);

+ 27 - 0
tests/Fixtures/Integration/priority/method_separation,braces.test

@@ -0,0 +1,27 @@
+--TEST--
+Integration of fixers: method_separation,braces.
+--RULESET--
+{"method_separation": true, "braces": true}
+--EXPECT--
+<?php
+
+class Foo
+{
+    /** bar */
+    public function bar()
+    {
+    }
+
+    /** baz */
+    public function baz()
+    {
+    }
+}
+
+--INPUT--
+<?php
+
+class Foo
+{
+    /** bar */public function bar() {}/** baz */public function baz() {}
+}

+ 21 - 0
tests/Fixtures/Integration/priority/phpdoc_no_access,phpdoc_separation.test

@@ -0,0 +1,21 @@
+--TEST--
+Integration of fixers: phpdoc_no_access,phpdoc_separation.
+--RULESET--
+{"phpdoc_no_access": true, "phpdoc_separation": true}
+--EXPECT--
+<?php
+/**
+ * @param $foo
+ * @param $bar
+ *
+ * @return bool
+ */
+
+--INPUT--
+<?php
+/**
+ * @access public
+ * @param $foo
+ * @param $bar
+ * @return bool
+ */

+ 24 - 0
tests/Fixtures/Integration/priority/phpdoc_order,phpdoc_separation.test

@@ -0,0 +1,24 @@
+--TEST--
+Integration of fixers: phpdoc_order,phpdoc_separation.
+--RULESET--
+{"phpdoc_order": true, "phpdoc_separation": true}
+--EXPECT--
+<?php
+/**
+ * Hello World!
+ *
+ * @param $foo
+ * @param $bar
+ *
+ * @return bool
+ */
+
+--INPUT--
+<?php
+/**
+ * Hello World!
+ *
+ * @return bool
+ * @param $foo
+ * @param $bar
+ */

+ 20 - 0
tests/Fixtures/Integration/priority/phpdoc_order,phpdoc_trim.test

@@ -0,0 +1,20 @@
+--TEST--
+Integration of fixers: phpdoc_order,phpdoc_trim.
+--RULESET--
+{"phpdoc_order": true, "phpdoc_trim": true}
+--EXPECT--
+<?php
+/**
+ * @param $foo
+ * @param $bar
+ * @return bool
+ */
+
+--INPUT--
+<?php
+/**
+ * @return bool
+ *
+ * @param $foo
+ * @param $bar
+ */