Skip to content
Snippets Groups Projects

Add support for phpunit 10

Merged Athos Ribeiro requested to merge athos/php-text-password:phpunit10 into master
3 files
+ 72
0
Compare changes
  • Side-by-side
  • Inline
Files
3
From: Athos Ribeiro <athoscribeiro@gmail.com>
Date: Mon, 11 Sep 2023 04:11:23 -0300
Subject: Support phpunit 10
Last-Update: 2023-09-11
Forwarded: no
---
Text_Password-1.2.1/tests/Text_Password_Test.php | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/Text_Password-1.2.1/tests/Text_Password_Test.php b/Text_Password-1.2.1/tests/Text_Password_Test.php
index 476a23d..9affdfb 100755
--- a/Text_Password-1.2.1/tests/Text_Password_Test.php
+++ b/Text_Password-1.2.1/tests/Text_Password_Test.php
@@ -75,32 +75,32 @@ class Text_Password_Test extends PHPUnit\Framework\TestCase
{
$password = Text_Password::create(8, 'unpronounceable', 'numeric');
- $this->assertRegExp("/^[0-9]{8}$/", $password);
+ $this->assertMatchesRegularExpression("/^[0-9]{8}$/", $password);
}
public function testCreateFromABCWithLength()
{
$password = Text_Password::create(8, 'unpronounceable', 'a,b,c');
- $this->assertRegExp("/^[abc]{8}$/i", $password);
+ $this->assertMatchesRegularExpression("/^[abc]{8}$/i", $password);
}
public function testCreateAlphabeticWithLength()
{
$password = Text_Password::create(8, 'unpronounceable', 'alphabetic');
- $this->assertRegExp("/^[a-z]{8}$/i", $password);
+ $this->assertMatchesRegularExpression("/^[a-z]{8}$/i", $password);
}
public function testCreateUnpronouncableWithAllClasses()
{
$password = Text_Password::create(8, 'unpronounceable', '');
- $this->assertRegExp('/^[a-z0-9_#@%&]{8}$/i', $password);
+ $this->assertMatchesRegularExpression('/^[a-z0-9_#@%&]{8}$/i', $password);
// Make sure all character classes are used at least once.
- $this->assertRegExp('/[a-z]/', $password);
- $this->assertRegExp('/[A-Z]/', $password);
- $this->assertRegExp('/[0-9]/', $password);
- $this->assertRegExp('/[_#@%&]/', $password);
+ $this->assertMatchesRegularExpression('/[a-z]/', $password);
+ $this->assertMatchesRegularExpression('/[A-Z]/', $password);
+ $this->assertMatchesRegularExpression('/[0-9]/', $password);
+ $this->assertMatchesRegularExpression('/[_#@%&]/', $password);
}
/**
@@ -110,7 +110,7 @@ class Text_Password_Test extends PHPUnit\Framework\TestCase
public function testCreateUnpronouncableShortWithAllClasses()
{
$password = Text_Password::create(2, 'unpronounceable', '');
- $this->assertRegExp('/^[a-z0-9_#@%&]{2}$/i', $password);
+ $this->assertMatchesRegularExpression('/^[a-z0-9_#@%&]{2}$/i', $password);
}
// {{{ Test cases for creating passwords based on a given login string
Loading