Browse Source

DX: provide doctyping for tests

Dariusz Ruminski 8 years ago
parent
commit
23518f6cb4

+ 5 - 0
tests/AbstractFunctionReferenceFixerTest.php

@@ -23,6 +23,11 @@ use PhpCsFixer\Tokenizer\Tokens;
 final class AbstractFunctionReferenceFixerTest extends \PHPUnit_Framework_TestCase
 {
     /**
+     * @param string $code
+     * @param int    $openIndex
+     * @param int    $closeIndex
+     * @param array  $arguments
+     *
      * @dataProvider provideCases
      */
     public function testCountArguments($code, $openIndex, $closeIndex, array $arguments)

+ 5 - 1
tests/ConfigTest.php

@@ -15,6 +15,7 @@ namespace PhpCsFixer\Tests;
 use PhpCsFixer\Config;
 use PhpCsFixer\Console\Command\FixCommand;
 use PhpCsFixer\Finder;
+use PhpCsFixer\FixerInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\Console\Tester\CommandTester;
 use Symfony\Component\Finder\Finder as SymfonyFinder;
@@ -117,9 +118,12 @@ final class ConfigTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param FixerInterface[] $expected
+     * @param iterable         $suite
+     *
      * @dataProvider provideRegisterCustomFixersCases
      */
-    public function testRegisterCustomFixers($expected, $suite)
+    public function testRegisterCustomFixers(array $expected, $suite)
     {
         $config = new Config();
         $config->registerCustomFixers($suite);

+ 6 - 0
tests/Console/Command/FixCommandTest.php

@@ -39,6 +39,12 @@ final class FixCommandTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int  $expected
+     * @param bool $isDryRun
+     * @param bool $hasChangedFiles
+     * @param bool $hasInvalidErrors
+     * @param bool $hasExceptionErrors
+     *
      * @dataProvider provideCalculateExitStatusCases
      */
     public function testCalculateExitStatus($expected, $isDryRun, $hasChangedFiles, $hasInvalidErrors, $hasExceptionErrors)

+ 10 - 0
tests/Console/ConfigurationResolverTest.php

@@ -158,6 +158,11 @@ final class ConfigurationResolverTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param string      $expectedFile
+     * @param string      $expectedClass
+     * @param string      $path
+     * @param null|string $cwdPath
+     *
      * @dataProvider provideResolveConfigFileDefaultCases
      */
     public function testResolveConfigFileChooseFile($expectedFile, $expectedClass, $path, $cwdPath = null)
@@ -379,6 +384,11 @@ final class ConfigurationResolverTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param array|Exception $expected
+     * @param null|Finder     $configFinder
+     * @param string          $pathMode
+     * @param null|string     $config
+     *
      * @dataProvider provideResolveIntersectionOfPathsCases
      */
     public function testResolveIntersectionOfPaths($expected, $configFinder, array $path, $pathMode, $config = null)

+ 21 - 0
tests/DocBlock/AnnotationTest.php

@@ -80,6 +80,9 @@ final class AnnotationTest extends \PHPUnit_Framework_TestCase
     private static $tags = array('param', 'param', 'param', 'throws', 'return');
 
     /**
+     * @param int    $index
+     * @param string $content
+     *
      * @dataProvider provideContent
      */
     public function testGetContent($index, $content)
@@ -103,6 +106,9 @@ final class AnnotationTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int $index
+     * @param int $start
+     *
      * @dataProvider provideStartCases
      */
     public function testStart($index, $start)
@@ -125,6 +131,9 @@ final class AnnotationTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int $index
+     * @param int $end
+     *
      * @dataProvider provideEndCases
      */
     public function testEnd($index, $end)
@@ -147,6 +156,9 @@ final class AnnotationTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int    $index
+     * @param string $tag
+     *
      * @dataProvider provideTags
      */
     public function testGetTag($index, $tag)
@@ -169,6 +181,10 @@ final class AnnotationTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int $index
+     * @param int $start
+     * @param int $end
+     *
      * @dataProvider provideRemoveCases
      */
     public function testRemove($index, $start, $end)
@@ -194,6 +210,11 @@ final class AnnotationTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param string[] $expected
+     * @param string[] $new
+     * @param string   $input
+     * @param string   $output
+     *
      * @dataProvider provideTypesCases
      */
     public function testTypes($expected, $new, $input, $output)

+ 11 - 0
tests/DocBlock/LineTest.php

@@ -113,6 +113,9 @@ final class LineTest extends \PHPUnit_Framework_TestCase
     );
 
     /**
+     * @param int    $pos
+     * @param string $content
+     *
      * @dataProvider provideLines
      */
     public function testPosAndContent($pos, $content)
@@ -124,6 +127,8 @@ final class LineTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int $pos
+     *
      * @dataProvider provideLines
      */
     public function testStarOrEndPos($pos)
@@ -158,6 +163,9 @@ final class LineTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int  $pos
+     * @param bool $useful
+     *
      * @dataProvider provideLinesWithUseful
      */
     public function testUseful($pos, $useful)
@@ -180,6 +188,9 @@ final class LineTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param int  $pos
+     * @param bool $tag
+     *
      * @dataProvider provideLinesWithTag
      */
     public function testTag($pos, $tag)

+ 4 - 0
tests/DocBlock/TagComparatorTest.php

@@ -24,6 +24,10 @@ use PhpCsFixer\DocBlock\TagComparator;
 final class TagComparatorTest extends \PHPUnit_Framework_TestCase
 {
     /**
+     * @param string $first
+     * @param string $second
+     * @param bool   $expected
+     *
      * @dataProvider provideComparatorCases
      */
     public function testComparatorTogether($first, $second, $expected)

+ 7 - 0
tests/DocBlock/TagTest.php

@@ -23,6 +23,10 @@ use PhpCsFixer\DocBlock\Tag;
 final class TagTest extends \PHPUnit_Framework_TestCase
 {
     /**
+     * @param string $expected
+     * @param string $new
+     * @param string $input
+     *
      * @dataProvider provideNameCases
      */
     public function testName($expected, $new, $input)
@@ -57,6 +61,9 @@ final class TagTest extends \PHPUnit_Framework_TestCase
     }
 
     /**
+     * @param bool   $expected
+     * @param string $input
+     *
      * @dataProvider provideValidCases
      */
     public function testValid($expected, $input)

+ 3 - 0
tests/Fixer/Alias/EchoToPrintFixerTest.php

@@ -22,6 +22,9 @@ use PhpCsFixer\Test\AbstractFixerTestCase;
 final class EchoToPrintFixerTest extends AbstractFixerTestCase
 {
     /**
+     * @param string      $expected
+     * @param null|string $input
+     *
      * @dataProvider provideFixCases
      */
     public function testFix($expected, $input = null)

+ 3 - 0
tests/Fixer/Alias/EregToPregFixerTest.php

@@ -22,6 +22,9 @@ use PhpCsFixer\Test\AbstractFixerTestCase;
 final class EregToPregFixerTest extends AbstractFixerTestCase
 {
     /**
+     * @param string      $expected
+     * @param null|string $input
+     *
      * @dataProvider provideExamples
      */
     public function testFix($expected, $input = null)

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