Skip to content

Commit

Permalink
advanced_passcode_test: phpunit 9 forward compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchamp authored Jan 28, 2025
1 parent b8475e5 commit 09822a2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/advanced_passcode_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class advanced_passcode_test extends basic_testcase {
* @param string $string String.
* @param string $message Message.
*/
public static function assertMatchesRegularExpression($pattern, $string, $message = ''): void {
public static function assertRegExp($pattern, $string, $message = ''): void {
// phpcs:enable
if (method_exists('basic_testcase', 'assertMatchesRegularExpression')) {
parent::assertMatchesRegularExpression($pattern, $string, $message);
Expand Down Expand Up @@ -126,8 +126,8 @@ public function test_settings_letter(): void {

$passcode = zoom_create_default_passcode($this->zoomdata);
$this->assertEquals(strlen($passcode), 6);
$this->assertMatchesRegularExpression('/\d/', $passcode);
$this->assertMatchesRegularExpression('/[a-zA-Z]/', $passcode);
$this->assertRegExp('/\d/', $passcode);
$this->assertRegExp('/[a-zA-Z]/', $passcode);
}

/**
Expand All @@ -145,9 +145,9 @@ public function test_settings_upper_and_lower_letters(): void {

$passcode = zoom_create_default_passcode($this->zoomdata);
$this->assertEquals(strlen($passcode), 6);
$this->assertMatchesRegularExpression('/\d/', $passcode);
$this->assertMatchesRegularExpression('/[A-Z]/', $passcode);
$this->assertMatchesRegularExpression('/[a-z]/', $passcode);
$this->assertRegExp('/\d/', $passcode);
$this->assertRegExp('/[A-Z]/', $passcode);
$this->assertRegExp('/[a-z]/', $passcode);
}

/**
Expand All @@ -165,8 +165,8 @@ public function test_settings_special_character(): void {

$passcode = zoom_create_default_passcode($this->zoomdata);
$this->assertEquals(strlen($passcode), 6);
$this->assertMatchesRegularExpression('/\d/', $passcode);
$this->assertMatchesRegularExpression('/[^a-zA-Z\d]/', $passcode);
$this->assertRegExp('/\d/', $passcode);
$this->assertRegExp('/[^a-zA-Z\d]/', $passcode);
}

/**
Expand All @@ -184,9 +184,9 @@ public function test_settings_all(): void {

$passcode = zoom_create_default_passcode($this->zoomdata);
$this->assertEquals(strlen($passcode), 7);
$this->assertMatchesRegularExpression('/\d/', $passcode);
$this->assertMatchesRegularExpression('/[a-zA-Z]/', $passcode);
$this->assertMatchesRegularExpression('/[^a-zA-Z\d]/', $passcode);
$this->assertRegExp('/\d/', $passcode);
$this->assertRegExp('/[a-zA-Z]/', $passcode);
$this->assertRegExp('/[^a-zA-Z\d]/', $passcode);
}

/**
Expand Down

0 comments on commit 09822a2

Please sign in to comment.