1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

fix: update tests

This commit is contained in:
Christy Jacob 2023-07-20 01:42:42 +04:00
parent 257776a54e
commit cd57da8ead
2 changed files with 7 additions and 7 deletions

View file

@ -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);

View file

@ -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);
}
}