Merge pull request #11096 from nupplaphil/feat/more_deprecated_notices
Replace assertRegExp() assertMatchesRegularExpression() & Upgrade phpunit.xml
This commit is contained in:
commit
0165811f09
5 changed files with 29 additions and 28 deletions
|
@ -1,30 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
bootstrap="bootstrap.php"
|
||||
verbose="true"
|
||||
backupGlobals="false"
|
||||
timeoutForSmallTests="900"
|
||||
timeoutForMediumTests="900"
|
||||
timeoutForLargeTests="900">
|
||||
<testsuite name='friendica'>
|
||||
<directory suffix='.php'>functional/</directory>
|
||||
<directory suffix='.php'>legacy/</directory>
|
||||
<directory suffix='.php'>src/</directory>
|
||||
timeoutForLargeTests="900"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||
<testsuite name="friendica">
|
||||
<directory suffix=".php">functional/</directory>
|
||||
<directory suffix=".php">legacy/</directory>
|
||||
<directory suffix=".php">src/</directory>
|
||||
</testsuite>
|
||||
<!-- Filters for Code Coverage -->
|
||||
<filter>
|
||||
<whitelist>
|
||||
<coverage>
|
||||
<include>
|
||||
<directory suffix=".php">..</directory>
|
||||
<exclude>
|
||||
<directory suffix=".php">../config/</directory>
|
||||
<directory suffix=".php">../doc/</directory>
|
||||
<directory suffix=".php">../images/</directory>
|
||||
<directory suffix=".php">../library/</directory>
|
||||
<directory suffix=".php">../spec/</directory>
|
||||
<directory suffix=".php">../tests/</directory>
|
||||
<directory suffix=".php">../view/</directory>
|
||||
<directory suffix=".php">../vendor/</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</include>
|
||||
<exclude>
|
||||
<directory suffix=".php">../config/</directory>
|
||||
<directory suffix=".php">../doc/</directory>
|
||||
<directory suffix=".php">../images/</directory>
|
||||
<directory suffix=".php">../library/</directory>
|
||||
<directory suffix=".php">../spec/</directory>
|
||||
<directory suffix=".php">../tests/</directory>
|
||||
<directory suffix=".php">../view/</directory>
|
||||
<directory suffix=".php">../vendor/</directory>
|
||||
</exclude>
|
||||
</coverage>
|
||||
</phpunit>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue