Browse Source

Add a handful of integration tests

Gert de Pagter 7 years ago
parent
commit
9c8e5c4851

+ 0 - 2
tests/AutoReview/FixerFactoryTest.php

@@ -272,12 +272,10 @@ final class FixerFactoryTest extends TestCase
         // This structure contains older cases that are not yet covered by tests.
         // This structure contains older cases that are not yet covered by tests.
         // It may only shrink, never add anything to it.
         // It may only shrink, never add anything to it.
         $casesWithoutTests = [
         $casesWithoutTests = [
-            'class_attributes_separation,braces.test',
             'class_attributes_separation,indentation_type.test',
             'class_attributes_separation,indentation_type.test',
             'indentation_type,phpdoc_indent.test',
             'indentation_type,phpdoc_indent.test',
             'method_separation,braces.test',
             'method_separation,braces.test',
             'method_separation,indentation_type.test',
             'method_separation,indentation_type.test',
-            'no_empty_statement,multiline_whitespace_before_semicolons.test',
             'no_empty_statement,no_multiline_whitespace_before_semicolons.test',
             'no_empty_statement,no_multiline_whitespace_before_semicolons.test',
             'phpdoc_no_access,phpdoc_order.test',
             'phpdoc_no_access,phpdoc_order.test',
             'phpdoc_no_access,phpdoc_separation.test',
             'phpdoc_no_access,phpdoc_separation.test',

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

@@ -0,0 +1,27 @@
+--TEST--
+Integration of fixers: class_attributes_separation, braces
+--RULESET--
+{"class_attributes_separation": true, "braces": true}
+--EXPECT--
+<?php
+
+class Foo
+{
+    /** 1 */
+    private $var1;
+
+    /** 2 */
+    private $var2;
+
+    /** 3 */
+    private $var3;
+}
+
+--INPUT--
+<?php
+
+class Foo
+{
+    /** 1 */
+    private $var1;/** 2 */private $var2;/** 3 */private $var3;
+}

+ 24 - 0
tests/Fixtures/Integration/priority/no_empty_statement,multiline_whitespace_before_semicolons.test

@@ -0,0 +1,24 @@
+--TEST--
+Integration of fixers: no_empty_statement,multiline_whitespace_before_semicolons.
+--RULESET--
+{"no_empty_statement": true, "multiline_whitespace_before_semicolons": {"strategy" : "no_multi_line"} }
+--EXPECT--
+<?php
+function foo() {
+    (new Bar)
+        ->hello()
+        ->chain()
+        ->more();
+
+}
+
+--INPUT--
+<?php
+function foo() {
+    (new Bar)
+        ->hello()
+        ->chain()
+        ->more()
+        ;
+;
+}