Skip to content

Commit

Permalink
[7.3] RandomApiMigrationFixerTest - tests for 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacePossum authored and keradus committed Jan 2, 2019
1 parent 4985316 commit a8d9ff4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/Fixer/Alias/RandomApiMigrationFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,34 @@ public function &rand();
],
];
}

/**
* @param string $expected
* @param string $input
* @param array $config
*
* @requires PHP 7.3
* @dataProvider provideFix73Cases
*/
public function testFix73($expected, $input, array $config = [])
{
$this->fixer->configure($config);

$this->doTest($expected, $input);
}

public function provideFix73Cases()
{
return [
[
'<?php $a = random_int(1,2,) + random_int(3,4,);',
'<?php $a = rand(1,2,) + mt_rand(3,4,);',
['replacements' => ['rand' => 'random_int', 'mt_rand' => 'random_int']],
],
[
'<?php mt_srand($a,);',
'<?php srand($a,);',
],
];
}
}

0 comments on commit a8d9ff4

Please sign in to comment.