add test case for adding Expression in if condition

This commit is contained in:
TomasVotruba 2018-01-03 19:34:03 +01:00
parent c075e24084
commit 84a44c753e
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<?php declare(strict_types=1);
final class MyTest extends \PHPUnit\Framework\TestCase
{
public function test()
{
if (true) {
$this->setExpectedException('SomeException');
$this->expectExceptionMessage($message);
}
}
}

View File

@ -23,6 +23,7 @@ final class DelegateExceptionArgumentsRectorTest extends AbstractRectorTestCase
return [
[__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'],
[__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'],
[__DIR__ . '/Wrong/wrong3.php.inc', __DIR__ . '/Correct/correct3.php.inc'],
];
}

View File

@ -0,0 +1,11 @@
<?php declare(strict_types=1);
final class MyTest extends \PHPUnit\Framework\TestCase
{
public function test()
{
if (true) {
$this->setExpectedException('SomeException', $message);
}
}
}