* 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\FunctionNotation; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author SpacePossum * * @internal * * @covers \PhpCsFixer\AbstractFopenFlagFixer * @covers \PhpCsFixer\Fixer\FunctionNotation\FopenFlagsFixer */ final class FopenFlagsFixerTest extends AbstractFixerTestCase { /** * @param string $expected * @param string $input * * @dataProvider provideFixCases */ public function testFix($expected, $input, array $config = []) { $this->fixer->configure($config); $this->doTest($expected, $input); } public function provideFixCases() { return [ 'missing "b"' => [ ' [ ' [ ' [ ' false], ], '"t" and superfluous "b"' => [ ' false], ], 'superfluous "b"' => [ ' false], ], ]; } /** * @param string $expected * * @dataProvider provideDoNotFixCases */ public function testDoNotFix($expected) { $this->doTest($expected); $this->fixer->configure(['b_mode' => false]); $this->doTest($expected); } public function provideDoNotFixCases() { return [ 'not simple flags' => [ ' [ ' [ ' [ ' [ ' [ 'fopen($foo, "r+");', ], 'comments, PHPDoc and literal' => [ ' [ '