]> git.mxchange.org Git - friendica.git/commitdiff
Replace `expectExceptionMessageRegExp()` with `expectExceptionMessageMatches()`
authorPhilipp <admin@philipp.info>
Sun, 23 May 2021 21:09:49 +0000 (23:09 +0200)
committerPhilipp <admin@philipp.info>
Sun, 23 May 2021 21:09:49 +0000 (23:09 +0200)
tests/src/Model/Storage/FilesystemStorageTest.php
tests/src/Util/BasePathTest.php
tests/src/Util/Config/ConfigFileLoaderTest.php
tests/src/Util/Logger/StreamLoggerTest.php
tests/src/Util/Logger/SyslogLoggerTest.php

index 6d50e06c40254f0ec3e28a32addb930818543c89..deb453a0483b3d2b6b37929f1ebcf54a71408434 100644 (file)
@@ -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);
 
index ffafa5b55a69bb37d6511c3cb815eb3cf2cc9a4e..7cdf612e64aa2ce31f40aeba0408ce8362c41335 100644 (file)
@@ -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();
index 781e1415f72d1fbeba2ae183f48f255208193183..b54ae1ec2d2d353bc35984f91a91b7d24287b64c 100644 (file)
@@ -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');
 
index f6bf3313a90eda62e98f87570e6dea6ff2c95b74..8599e08f45edd6651e117ea5fd5ff0db618bfe30 100644 (file)
@@ -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);
index 9408495e747f2b57a069ff7527f3daa89a9fed2a..e93e43dd5c03e8159694efcb33230c84004f47de 100644 (file)
@@ -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");