Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Unit/UserTest.php
Show All 13 Lines | class UserTest extends TestCase | ||||
{ | { | ||||
$user = new User(['email' => 'user@email.com']); | $user = new User(['email' => 'user@email.com']); | ||||
$user->password = 'test'; | $user->password = 'test'; | ||||
$ssh512 = "{SSHA512}7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ" | $ssh512 = "{SSHA512}7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ" | ||||
. "6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="; | . "6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="; | ||||
$this->assertRegExp('/^\$2y\$12\$[0-9a-zA-Z\/.]{53}$/', $user->password); | $this->assertMatchesRegularExpression('/^\$2y\$12\$[0-9a-zA-Z\/.]{53}$/', $user->password); | ||||
$this->assertSame($ssh512, $user->password_ldap); | $this->assertSame($ssh512, $user->password_ldap); | ||||
} | } | ||||
/** | /** | ||||
* Test User password mutator | * Test User password mutator | ||||
*/ | */ | ||||
public function testSetPasswordLdapAttribute(): void | public function testSetPasswordLdapAttribute(): void | ||||
{ | { | ||||
$user = new User(['email' => 'user@email.com']); | $user = new User(['email' => 'user@email.com']); | ||||
$user->password_ldap = 'test'; | $user->password_ldap = 'test'; | ||||
$ssh512 = "{SSHA512}7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ" | $ssh512 = "{SSHA512}7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ" | ||||
. "6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="; | . "6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="; | ||||
$this->assertRegExp('/^\$2y\$12\$[0-9a-zA-Z\/.]{53}$/', $user->password); | $this->assertMatchesRegularExpression('/^\$2y\$12\$[0-9a-zA-Z\/.]{53}$/', $user->password); | ||||
$this->assertSame($ssh512, $user->password_ldap); | $this->assertSame($ssh512, $user->password_ldap); | ||||
} | } | ||||
/** | /** | ||||
* Test basic User funtionality | * Test basic User funtionality | ||||
*/ | */ | ||||
public function testStatus(): void | public function testStatus(): void | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |