Browse Source

IntegrationTest - ensure tests in priority dir are priority tests indeed

Dariusz Ruminski 7 years ago
parent
commit
b6a9c1e5f2

+ 2 - 1
.gitattributes

@@ -1,4 +1,4 @@
-# @TODO 3.0 replace following `tests/... exportignore` with single `tests/ export-ignore`
+# @TODO 3.0 replace following `tests/... export-ignore` with single `tests/ export-ignore`
 tests/**/*Test.php export-ignore
 tests/AbstractDoctrineAnnotationFixerTestCase.php export-ignore
 tests/Differ/AbstractDifferTestCase.php export-ignore
@@ -6,6 +6,7 @@ tests/Fixtures/ export-ignore
 tests/Linter/AbstractLinterTestCase.php export-ignore
 tests/Report/AbstractReporterTestCase.php export-ignore
 tests/Test/AbstractTransformerTestCase.php export-ignore
+tests/Test/InternalIntegrationCaseFactory.php export-ignore
 
 .appveyor.yml export-ignore
 .composer-require-checker.json export-ignore

+ 11 - 2
.travis.yml

@@ -35,8 +35,17 @@ jobs:
                 - composer info -D | sort
             script:
                 # @TODO remove at 3.0
-                - git archive -o /dev/null HEAD -v 2>&1 | grep tests | grep \.php | grep -v tests/TestCase.php | grep -v tests/Test/Assert/AssertTokensTrait.php | grep -v tests/Test/AbstractFixerTestCase.php | grep -v tests/Test/AbstractIntegrationTestCase.php | grep -v tests/Test/IntegrationCase.php | grep -v tests/Test/IntegrationCaseFactory.php && (echo "UNKNOWN FILES DETECTED" && travis_terminate 1) || echo "NO UNKNOWN FILES"
-
+                - |
+                  git archive -o /dev/null HEAD -v 2>&1 | grep tests | grep \.php \
+                    | grep -v tests/Test/AbstractFixerTestCase.php \
+                    | grep -v tests/Test/AbstractIntegrationCaseFactory.php \
+                    | grep -v tests/Test/AbstractIntegrationTestCase.php \
+                    | grep -v tests/Test/Assert/AssertTokensTrait.php \
+                    | grep -v tests/Test/IntegrationCase.php \
+                    | grep -v tests/Test/IntegrationCaseFactory.php \
+                    | grep -v tests/Test/IntegrationCaseFactoryInterface.php \
+                    | grep -v tests/TestCase.php \
+                    && (echo "UNKNOWN FILES DETECTED" && travis_terminate 1) || echo "NO UNKNOWN FILES"
                 - ./check_trailing_spaces.sh || travis_terminate 1
                 - ./dev-tools/vendor/bin/composer-require-checker check composer.json --config-file=.composer-require-checker.json
 

+ 3 - 1
composer.json

@@ -58,9 +58,11 @@
         "classmap": [
             "tests/TestCase.php",
             "tests/Test/AbstractFixerTestCase.php",
+            "tests/Test/AbstractIntegrationCaseFactory.php",
             "tests/Test/AbstractIntegrationTestCase.php",
             "tests/Test/IntegrationCase.php",
-            "tests/Test/IntegrationCaseFactory.php"
+            "tests/Test/IntegrationCaseFactory.php",
+            "tests/Test/IntegrationCaseFactoryInterface.php"
         ]
     },
     "autoload-dev": {

+ 1 - 1
src/Fixer/LanguageConstruct/SilencedDeprecationErrorFixer.php

@@ -70,7 +70,7 @@ final class SilencedDeprecationErrorFixer extends AbstractFixer
                 $prev = $tokens->getPrevMeaningfulToken($start);
             }
 
-            if ($tokens[$prev]->isGivenKind(T_STRING) || $tokens[$prev]->equals('@')) {
+            if ($tokens[$prev]->isGivenKind(array(T_DOUBLE_COLON, T_NEW, T_OBJECT_OPERATOR, T_STRING)) || $tokens[$prev]->equals('@')) {
                 continue;
             }
 

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

@@ -45,7 +45,7 @@ final class PhpdocNoUselessInheritdocFixer extends AbstractFixer
      */
     public function getPriority()
     {
-        // Should run before NoEmptyPhpdocFixer, PhpdocInlineTagFixer and NoTrailingWhitespaceInCommentFixer
+        // Should run before NoEmptyPhpdocFixer, NoTrailingWhitespaceInCommentFixer
         // and after PhpdocToCommentFixer.
         return 6;
     }

+ 0 - 2
tests/AutoReview/FixerFactoryTest.php

@@ -143,7 +143,6 @@ final class FixerFactoryTest extends TestCase
             array($fixers['phpdoc_no_package'], $fixers['phpdoc_trim']),
             array($fixers['phpdoc_no_useless_inheritdoc'], $fixers['no_empty_phpdoc']),
             array($fixers['phpdoc_no_useless_inheritdoc'], $fixers['no_trailing_whitespace_in_comment']),
-            array($fixers['phpdoc_no_useless_inheritdoc'], $fixers['phpdoc_inline_tag']),
             array($fixers['phpdoc_order'], $fixers['phpdoc_separation']),
             array($fixers['phpdoc_order'], $fixers['phpdoc_trim']),
             array($fixers['phpdoc_separation'], $fixers['phpdoc_trim']),
@@ -162,7 +161,6 @@ final class FixerFactoryTest extends TestCase
             array($fixers['single_import_per_statement'], $fixers['no_multiline_whitespace_before_semicolons']),
             array($fixers['single_import_per_statement'], $fixers['no_singleline_whitespace_before_semicolons']),
             array($fixers['single_import_per_statement'], $fixers['no_unused_imports']),
-            array($fixers['single_import_per_statement'], $fixers['ordered_imports']),
             array($fixers['single_import_per_statement'], $fixers['space_after_semicolon']),
             array($fixers['unary_operator_spaces'], $fixers['not_operator_with_space']),
             array($fixers['unary_operator_spaces'], $fixers['not_operator_with_successor_space']),

+ 1 - 0
tests/AutoReview/ProjectCodeTest.php

@@ -216,6 +216,7 @@ final class ProjectCodeTest extends TestCase
         $rc = new \ReflectionClass($className);
 
         $this->assertTrue(
+            $rc->isInterface() || // due to hhvm only, @TODO remove me whem hhvm support is dropped
             $rc->isAbstract() || $rc->isFinal(),
             sprintf('Test class %s should be abstract or final.', $className)
         );

+ 12 - 0
tests/Fixer/LanguageConstruct/SilencedDeprecationErrorFixerTest.php

@@ -67,6 +67,18 @@ final class SilencedDeprecationErrorFixerTest extends AbstractFixerTestCase
                 '<?php //
 Trigger_Error/**/("This is a deprecation warning.", E_USER_DEPRECATED/***/); ?>',
             ),
+            array(
+                '<?php new trigger_error("This is not a deprecation warning.", E_USER_DEPRECATED); ?>',
+            ),
+            array(
+                '<?php new \trigger_error("This is not a deprecation warning.", E_USER_DEPRECATED); ?>',
+            ),
+            array(
+                '<?php $foo->trigger_error("This is not a deprecation warning.", E_USER_DEPRECATED); ?>',
+            ),
+            array(
+                '<?php Foo::trigger_error("This is not a deprecation warning.", E_USER_DEPRECATED); ?>',
+            ),
         );
     }
 }

+ 0 - 0
tests/Fixtures/Integration/priority/phpdoc_no_useless_inheritdoc,phpdoc_inline_tag.test → tests/Fixtures/Integration/misc/phpdoc_no_useless_inheritdoc,phpdoc_inline_tag.test


+ 0 - 0
tests/Fixtures/Integration/priority/single_import_per_statement,ordered_imports.test → tests/Fixtures/Integration/misc/single_import_per_statement,ordered_imports.test


Some files were not shown because too many files changed in this diff