* 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\LanguageConstruct; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Vladimir Reznichenko * * @internal * * @covers \PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer */ final class IsNullFixerTest extends AbstractFixerTestCase { /** * @dataProvider provideFixCases * * @param string $expected * @param null|string $input */ public function testFix($expected, $input = null) { $this->doTest($expected, $input); } public function provideFixCases() { $multiLinePatternToFix = <<<'FIX' is_null(json_decode($x));'], ['', "", ], [ '', ], // edge cases: is_null wrapped into a binary operations [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ ' (null === $a)); ?>', ' is_null($a)); ?>', ], [ ' false); ?>', ' false); ?>', ], [ '', '', ], // check with logical operator [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], [ '', '', ], ]; } }