Skip to content

Commit

Permalink
minor #4207 [7.3] RandomApiMigrationFixerTest - tests for 7.3 (SpaceP…
Browse files Browse the repository at this point in the history
…ossum)

This PR was merged into the 2.12 branch.

Discussion
----------

[7.3] RandomApiMigrationFixerTest - tests for 7.3

Commits
-------

a8d9ff4 [7.3] RandomApiMigrationFixerTest - tests for 7.3
  • Loading branch information
keradus committed Jan 2, 2019
2 parents 4985316 + a8d9ff4 commit f9915ed
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 f9915ed

Please sign in to comment.