]> git.mxchange.org Git - friendica.git/commitdiff
Replace assertRegExp() assertMatchesRegularExpression()
authorPhilipp <admin@philipp.info>
Sun, 12 Dec 2021 19:19:52 +0000 (20:19 +0100)
committerPhilipp <admin@philipp.info>
Sun, 12 Dec 2021 19:19:52 +0000 (20:19 +0100)
tests/src/Core/Logger/AbstractLoggerTest.php
tests/src/Core/Logger/WorkerLoggerTest.php
tests/src/Core/SystemTest.php
tests/src/Util/ProfilerTest.php

index d85e754c3f9e8298551bed1cb39a7f7ab3442950..64ff1e79f24603924c271f45ff16434ba2d69cc9 100644 (file)
@@ -31,7 +31,7 @@ abstract class AbstractLoggerTest extends MockedTest
 {
        use LoggerDataTrait;
 
-       const LOGLINE = '/.* \[.*\]: .* \{.*\"file\":\".*\".*,.*\"line\":\d*,.*\"function\":\".*\".*,.*\"uid\":\".*\".*}/';
+       const LOGLINE = '/.* \[.*]: .* {.*\"file\":\".*\".*,.*\"line\":\d*,.*\"function\":\".*\".*,.*\"uid\":\".*\".*}/';
 
        const FILE = 'test';
        const LINE = 666;
@@ -72,7 +72,7 @@ abstract class AbstractLoggerTest extends MockedTest
 
        public function assertLogline($string)
        {
-               self::assertRegExp(self::LOGLINE, $string);
+               self::assertMatchesRegularExpression(self::LOGLINE, $string);
        }
 
        public function assertLoglineNums($assertNum, $string)
index 39b217552ff1e6386542b1e657f12cc1ecfe58a7..bec08494bfc00a97b2fd39f9a1b832183b8406fc 100644 (file)
@@ -29,7 +29,7 @@ class WorkerLoggerTest extends MockedTest
 {
        private function assertUid($uid)
        {
-               self::assertRegExp('/^[a-zA-Z0-9]{' . WorkerLogger::WORKER_ID_LENGTH . '}+$/', $uid);
+               self::assertMatchesRegularExpression('/^[a-zA-Z0-9]{' . WorkerLogger::WORKER_ID_LENGTH . '}+$/', $uid);
        }
 
        public function dataTest()
index f37d2a2937bf54c520d3fb458ee5a292fc1f5929..8dc43f36f90794771a6124a139a40c86ce6859dd 100644 (file)
@@ -42,7 +42,7 @@ class SystemTest extends TestCase
        private function assertGuid($guid, $length, $prefix = '')
        {
                $length -= strlen($prefix);
-               self::assertRegExp("/^" . $prefix . "[a-z0-9]{" . $length . "}?$/", $guid);
+               self::assertMatchesRegularExpression("/^" . $prefix . "[a-z0-9]{" . $length . "}?$/", $guid);
        }
 
        public function testGuidWithoutParameter()
index 9a9492d172d755c684074adbccced93390a427c8..6e0eb80f35c08cf0d38f27059315a529a5a1c618 100644 (file)
@@ -229,7 +229,7 @@ class ProfilerTest extends MockedTest
                foreach ($data as $perf => $items) {
                        foreach ($items['functions'] as $function) {
                                // assert that the output contains the functions
-                               self::assertRegExp('/' . $function . ': \d+/', $output);
+                               self::assertMatchesRegularExpression('/' . $function . ': \d+/', $output);
                        }
                }
        }
@@ -286,7 +286,7 @@ class ProfilerTest extends MockedTest
 
                self::assertTrue($profiler->isRendertime());
                $output = $profiler->getRendertimeString();
-               self::assertRegExp('/test1: \d+/', $output);
-               self::assertRegExp('/test2: \d+/', $output);
+               self::assertMatchesRegularExpression('/test1: \d+/', $output);
+               self::assertMatchesRegularExpression('/test2: \d+/', $output);
        }
 }