* Dariusz Rumiński * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Fixer\Phpdoc; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; use PhpCsFixer\WhitespacesFixerConfig; /** * @author Filippo Tessarotto * * @internal * * @covers \PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer */ final class AlignMultilineCommentFixerTest extends AbstractFixerTestCase { public function testInvalidConfiguration() { $this->expectException(\PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException::class); $this->fixer->configure(['a' => 1]); } /** * @param string $expected * @param null|string $input * * @dataProvider provideDefaultCases */ public function testDefaults($expected, $input = null) { $this->doTest($expected, $input); } public function provideDefaultCases() { return [ [ ' [ 'fixer->configure(['comment_type' => 'phpdocs_like']); $this->doTest($expected, $input); } public function provideDocLikeMultilineCommentsCases() { return [ [ 'fixer->configure(['comment_type' => 'all_multiline']); $this->doTest($expected, $input); } public function provideMixedContentMultilineCommentsCases() { return [ [ 'fixer->setWhitespacesConfig(new WhitespacesFixerConfig("\t", "\r\n")); $expected = str_replace("\n", "\r\n", $expected); if (null !== $input) { $input = str_replace("\n", "\r\n", $input); } $this->doTest($expected, $input); } }