fix: update tests
This commit is contained in:
parent
257776a54e
commit
cd57da8ead
2 changed files with 7 additions and 7 deletions
|
@ -37,6 +37,10 @@ class PersonalData extends Password
|
|||
*/
|
||||
public function isValid($password): bool
|
||||
{
|
||||
if (!parent::isValid($password)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$this->strict) {
|
||||
$password = strtolower($password);
|
||||
$this->userId = strtolower($this->userId);
|
||||
|
|
|
@ -42,6 +42,9 @@ class PersonalDataTest extends TestCase
|
|||
$this->assertEquals($this->object->isValid('something.email'), false);
|
||||
$this->assertEquals($this->object->isValid('email.something'), false);
|
||||
$this->assertEquals($this->object->isValid('something.email.something'), false);
|
||||
|
||||
/** Test for success */
|
||||
$this->assertEquals($this->object->isValid('893pu5egerfsv3rgersvd'), true);
|
||||
}
|
||||
|
||||
public function testNotStrict(): void
|
||||
|
@ -75,11 +78,4 @@ class PersonalDataTest extends TestCase
|
|||
$this->assertEquals($this->object->isValid('EMAIL.something'), false);
|
||||
$this->assertEquals($this->object->isValid('something.EMAIL.something'), false);
|
||||
}
|
||||
|
||||
public function testSuccess(): void
|
||||
{
|
||||
$this->object = new PersonalData('userId', 'email@example.com', 'name', '+129492323', false);
|
||||
$this->assertEquals($this->object->isValid('foo'), true);
|
||||
$this->assertEquals($this->object->isValid('bar'), true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue