Skip to content

Commit

Permalink
PhpUnitExpectationFixerTest - add case with multiple candidates
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacePossum authored and kubawerlos committed Jul 11, 2018
1 parent 8fa9513 commit 1917dcd
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions tests/Fixer/PhpUnit/PhpUnitExpectationFixerTest.php
Expand Up @@ -286,31 +286,40 @@ public function testMessyWhitespaces($expected, $input = null)

public function provideMessyWhitespacesCases()
{
return [
[
'<?php
final class MyTest extends \PHPUnit_Framework_TestCase
{
function testFnc()
$expectedTemplate =
'
function testFnc%d()
{
aaa();
$this->expectException(\'RuntimeException\');
$this->expectExceptionMessage(\'msg\'/*B*/);
$this->expectExceptionCode(/*C*/123);
zzz();
}
}',
'<?php
final class MyTest extends \PHPUnit_Framework_TestCase
{
function testFnc()
';
$inputTemplate =
'
function testFnc%d()
{
aaa();
$this->setExpectedException(\'RuntimeException\', \'msg\'/*B*/, /*C*/123);
zzz();
}
}',
],
];
'
;
$input = $expected = '<?php
final class MyTest extends \PHPUnit_Framework_TestCase
{
';

for ($i = 0; $i < 8; ++$i) {
$expected .= sprintf($expectedTemplate, $i);
$input .= sprintf($inputTemplate, $i);
}

$expected .= "\n}";
$input .= "\n}";

return [[$expected, $input]];
}
}

0 comments on commit 1917dcd

Please sign in to comment.