0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

try and fix phpunit deprecation warning - assertRegExp => assertMatchesRegularExpression

This commit is contained in:
David Goodwin 2024-04-22 21:08:57 +01:00
parent f01274ec94
commit 2eb7f34844
No known key found for this signature in database
4 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ class CheckDomainTest extends \PHPUnit\Framework\TestCase
{
$this->assertEquals('', check_domain('example.com'));
$this->assertEquals('', check_domain('google.com'));
$this->assertRegExp('/ not discoverable in DNS/', check_domain('fishbeansblahblahblah' . uniqid() . '.com'));
$this->assertMatchesRegularExpression('/ not discoverable in DNS/', check_domain('fishbeansblahblahblah' . uniqid() . '.com'));
}
}

View File

@ -8,7 +8,7 @@ class CheckEmailTest extends \PHPUnit\Framework\TestCase
public function testBasic()
{
$this->assertEquals('', check_email('test@example.com'));
$this->assertRegExp('/ not discoverable in DNS/', check_email('test@fishbeansblahblahblah' . uniqid() . '.com'));
$this->assertMatchesRegularExpression('/ not discoverable in DNS/', check_email('test@fishbeansblahblahblah' . uniqid() . '.com'));
}
}

View File

@ -43,7 +43,7 @@ class CreatePageBrowserTest extends \PHPUnit\Framework\TestCase
$b = create_page_browser('mailbox.username', 'FROM mailbox WHERE 1 = 1');
$this->assertEquals(10, sizeof($b));
foreach ($b as $range) {
$this->assertRegExp('/[\w]{2}\-[\w]{2}/', $range);
$this->assertMatchesRegularExpression('/[\w]{2}\-[\w]{2}/', $range);
}
$this->assertNotEmpty($b);
}

View File

@ -170,7 +170,7 @@ class PaCryptTest extends \PHPUnit\Framework\TestCase
$this->assertEquals($enc, _pacrypt_php_crypt($password, $enc));
$this->assertRegExp('/^\{SHA256-CRYPT\}/', $enc);
$this->assertMatchesRegularExpression('/^\{SHA256-CRYPT\}/', $enc);
$this->assertGreaterThan(20, strlen($enc));
}
@ -303,7 +303,7 @@ class PaCryptTest extends \PHPUnit\Framework\TestCase
$x = pacrypt('test123');
$this->assertRegExp('/^\{SHA512-CRYPT\.B64/', $x);
$this->assertMatchesRegularExpression('/^\{SHA512-CRYPT\.B64/', $x);
$this->assertTrue(strlen($x) > 50);
$this->assertEquals($x, pacrypt('test123', $x));