Tests > fix "Call to undefined method setExpectedException()" bug > make compatible with PHPUnit 8.0 (and PHP 7.2+)

This commit is contained in:
Meritoo
2019-04-02 08:31:24 +02:00
parent 8b5a530bbc
commit c89b6da0db
7 changed files with 20 additions and 20 deletions

View File

@@ -49,8 +49,8 @@ class BundleTest extends BaseTestCase
$template = 'Name of bundle \'%s\' is incorrect. It should start with big letter and end with "Bundle". Is'
. ' there everything ok?';
$message = sprintf($template, $bundleName);
$this->setExpectedException(IncorrectBundleNameException::class, $message);
$this->expectException(IncorrectBundleNameException::class);
$this->expectExceptionMessage(sprintf($template, $bundleName));
Bundle::getBundleViewPath($viewPath, $bundleName);
}
@@ -90,7 +90,7 @@ class BundleTest extends BaseTestCase
*/
public function testGetShortBundleNameUsingEmptyValue($emptyValue)
{
$this->setExpectedException(IncorrectBundleNameException::class);
$this->expectException(IncorrectBundleNameException::class);
Bundle::getShortBundleName($emptyValue);
}
@@ -102,7 +102,7 @@ class BundleTest extends BaseTestCase
*/
public function testGetShortBundleNameUsingIncorrectBundleName($bundleName)
{
$this->setExpectedException(IncorrectBundleNameException::class);
$this->expectException(IncorrectBundleNameException::class);
Bundle::getShortBundleName($bundleName);
}