Skip to content

Commit

Permalink
Update UserTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Oct 18, 2024
1 parent e9c14d3 commit 9049f21
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions tests/Unit/Models/ActiveDirectory/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public function test_set_password_behaves_identically_on_non_user_models()
->getLdapConnection()
->expect(LdapFake::operation('isUsingSSL')->andReturnTrue());

$user = new User();
$user = new User;

$user->unicodepwd = 'foo';

$nonUser = new Entry();
$nonUser = new Entry;

$nonUser->unicodepwd = Password::encode('foo');

Expand All @@ -89,7 +89,7 @@ public function test_create_user_with_password()
))->andReturnTrue(),
]);

$user = new User();
$user = new User;

$user->password = 'foobar';
$user->userAccountControl = 512;
Expand Down Expand Up @@ -123,7 +123,7 @@ function ($mods) {
)->andReturnTrue(),
]);

$user = new User();
$user = new User;

$user->setRawAttributes([
'useraccountcontrol' => [512],
Expand All @@ -137,7 +137,7 @@ function ($mods) {

public function test_reject_computer_object_class_is_a_default_scope()
{
$this->assertInstanceOf(RejectComputerObjectClass::class, (new User())->getGlobalScopes()[RejectComputerObjectClass::class]);
$this->assertInstanceOf(RejectComputerObjectClass::class, (new User)->getGlobalScopes()[RejectComputerObjectClass::class]);
}

public function test_scope_where_has_mailbox_is_applied()
Expand All @@ -163,7 +163,7 @@ public function test_is_locked_out()
Carbon::now()->subMinutes(10)
);

$user = (new User())->setRawAttributes(
$user = (new User)->setRawAttributes(
['lockouttime' => [$lockoutTime]]
);

Expand All @@ -177,7 +177,7 @@ public function test_is_locked_out_with_only_duration()
Carbon::now()->subMinutes(10)
);

$user = (new User())->setRawAttributes(
$user = (new User)->setRawAttributes(
['lockouttime' => [$lockoutTime]]
);

Expand All @@ -187,12 +187,12 @@ public function test_is_locked_out_with_only_duration()

public function test_user_with_no_account_control_returns_zero_value()
{
$this->assertEquals(0, (new User())->accountControl()->getValue());
$this->assertEquals(0, (new User)->accountControl()->getValue());
}

public function test_user_with_account_control_returns_hydrated_account_control_instance()
{
$uac = (new User())->setRawAttribute('useraccountcontrol', '514')->accountControl();
$uac = (new User)->setRawAttribute('useraccountcontrol', '514')->accountControl();

$this->assertSame(514, $uac->getValue());
$this->assertTrue($uac->hasFlag(AccountControl::ACCOUNTDISABLE));
Expand All @@ -202,7 +202,7 @@ public function test_user_with_account_control_returns_hydrated_account_control_

public function test_user_can_have_account_control_object_set_on_attribute()
{
$user = new User();
$user = new User;

$uac = $user->accountControl();

Expand All @@ -213,7 +213,7 @@ public function test_user_can_have_account_control_object_set_on_attribute()

public function test_user_is_disabled()
{
$user = new User();
$user = new User;

$this->assertFalse($user->isDisabled());

Expand All @@ -228,7 +228,7 @@ public function test_user_is_disabled()

public function test_user_is_enabled()
{
$user = new User();
$user = new User;

$this->assertTrue($user->isEnabled());

Expand All @@ -243,7 +243,7 @@ public function test_user_is_enabled()

public function test_account_expires_with_maximum()
{
$user = new User();
$user = new User;

$max = Timestamp::WINDOWS_INT_MAX;

Expand All @@ -254,7 +254,7 @@ public function test_account_expires_with_maximum()

public function test_account_expires_with_minimum()
{
$user = new User();
$user = new User;

$user->accountExpires = 0;

Expand All @@ -273,11 +273,7 @@ public function test_correct_auth_identifier_is_returned()

class UserPasswordTestStub extends User
{
protected function assertSecureConnection(): void
{
}
protected function assertSecureConnection(): void {}
}

class NonUserPasswordTestStub extends Model
{
}
class NonUserPasswordTestStub extends Model {}

0 comments on commit 9049f21

Please sign in to comment.