diff --git a/tests/src/Model/Storage/FilesystemStorageTest.php b/tests/src/Model/Storage/FilesystemStorageTest.php index 6d50e06c40..deb453a048 100644 --- a/tests/src/Model/Storage/FilesystemStorageTest.php +++ b/tests/src/Model/Storage/FilesystemStorageTest.php @@ -81,7 +81,7 @@ class FilesystemStorageTest extends StorageTest public function testMissingDirPermissions() { $this->expectException(StorageException::class); - $this->expectExceptionMessageRegExp("/Filesystem storage failed to create \".*\". Check you write permissions./"); + $this->expectExceptionMessageMatches("/Filesystem storage failed to create \".*\". Check you write permissions./"); $this->root->getChild('storage')->chmod(000); $instance = $this->getInstance(); @@ -97,7 +97,7 @@ class FilesystemStorageTest extends StorageTest static::markTestIncomplete("Cannot catch file_put_content() error due vfsStream failure"); $this->expectException(StorageException::class); - $this->expectExceptionMessageRegExp("/Filesystem storage failed to save data to \".*\". Check your write permissions/"); + $this->expectExceptionMessageMatches("/Filesystem storage failed to save data to \".*\". Check your write permissions/"); vfsStream::create(['storage' => ['f0' => ['c0' => ['k0i0' => '']]]], $this->root); diff --git a/tests/src/Util/BasePathTest.php b/tests/src/Util/BasePathTest.php index ffafa5b55a..7cdf612e64 100644 --- a/tests/src/Util/BasePathTest.php +++ b/tests/src/Util/BasePathTest.php @@ -68,7 +68,7 @@ class BasePathTest extends MockedTest public function testFailedBasePath() { $this->expectException(\Exception::class); - $this->expectExceptionMessageRegExp("/(.*) is not a valid basepath/"); + $this->expectExceptionMessageMatches("/(.*) is not a valid basepath/"); $basepath = new BasePath('/now23452sgfgas', []); $basepath->getPath(); diff --git a/tests/src/Util/Config/ConfigFileLoaderTest.php b/tests/src/Util/Config/ConfigFileLoaderTest.php index 781e1415f7..b54ae1ec2d 100644 --- a/tests/src/Util/Config/ConfigFileLoaderTest.php +++ b/tests/src/Util/Config/ConfigFileLoaderTest.php @@ -59,7 +59,7 @@ class ConfigFileLoaderTest extends MockedTest */ public function testLoadConfigWrong() { - $this->expectExceptionMessageRegExp("/Error loading config file \w+/"); + $this->expectExceptionMessageMatches("/Error loading config file \w+/"); $this->expectException(\Exception::class); $this->delConfigFile('local.config.php'); diff --git a/tests/src/Util/Logger/StreamLoggerTest.php b/tests/src/Util/Logger/StreamLoggerTest.php index f6bf3313a9..8599e08f45 100644 --- a/tests/src/Util/Logger/StreamLoggerTest.php +++ b/tests/src/Util/Logger/StreamLoggerTest.php @@ -128,7 +128,7 @@ class StreamLoggerTest extends AbstractLoggerTest public function testWrongUrl() { $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp("/The stream or file .* could not be opened: .* /"); + $this->expectExceptionMessageMatches("/The stream or file .* could not be opened: .* /"); $logfile = vfsStream::newFile('friendica.log') ->at($this->root)->chmod(0); @@ -144,7 +144,7 @@ class StreamLoggerTest extends AbstractLoggerTest public function testWrongDir() { $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp("/Directory .* cannot get created: .* /"); + $this->expectExceptionMessageMatches("/Directory .* cannot get created: .* /"); static::markTestIncomplete('We need a platform independent way to set directory to readonly'); @@ -159,7 +159,7 @@ class StreamLoggerTest extends AbstractLoggerTest public function testWrongMinimumLevel() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessageRegExp("/The level \".*\" is not valid./"); + $this->expectExceptionMessageMatches("/The level \".*\" is not valid./"); $logger = new StreamLogger('test', 'file.text', $this->introspection, $this->fileSystem, 'NOPE'); } @@ -170,7 +170,7 @@ class StreamLoggerTest extends AbstractLoggerTest public function testWrongLogLevel() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessageRegExp("/The level \".*\" is not valid./"); + $this->expectExceptionMessageMatches("/The level \".*\" is not valid./"); $logfile = vfsStream::newFile('friendica.log') ->at($this->root); diff --git a/tests/src/Util/Logger/SyslogLoggerTest.php b/tests/src/Util/Logger/SyslogLoggerTest.php index 9408495e74..e93e43dd5c 100644 --- a/tests/src/Util/Logger/SyslogLoggerTest.php +++ b/tests/src/Util/Logger/SyslogLoggerTest.php @@ -63,7 +63,7 @@ class SyslogLoggerTest extends AbstractLoggerTest public function testWrongMinimumLevel() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessageRegExp("/The level \".*\" is not valid./"); + $this->expectExceptionMessageMatches("/The level \".*\" is not valid./"); $logger = new SyslogLoggerWrapper('test', $this->introspection, 'NOPE'); } @@ -74,7 +74,7 @@ class SyslogLoggerTest extends AbstractLoggerTest public function testWrongLogLevel() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessageRegExp("/The level \".*\" is not valid./"); + $this->expectExceptionMessageMatches("/The level \".*\" is not valid./"); $logger = new SyslogLoggerWrapper('test', $this->introspection); @@ -88,7 +88,7 @@ class SyslogLoggerTest extends AbstractLoggerTest { if (PHP_MAJOR_VERSION < 8) { $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessageRegExp("/Can\'t open syslog for ident \".*\" and facility \".*\": .* /"); + $this->expectExceptionMessageMatches("/Can\'t open syslog for ident \".*\" and facility \".*\": .* /"); } else { $this->expectException(\TypeError::class); $this->expectExceptionMessage("openlog(): Argument #3 (\$facility) must be of type int, string given");