updates for active directory now with docs
This commit is contained in:
@@ -268,3 +268,29 @@ it('registers an overlap-protected ten-minute job only when scheduling is enable
|
||||
->and($events->sole()->command)->toBe(Artisan::formatCommandString('ad:sync'));
|
||||
}
|
||||
})->with(['enabled' => [true], 'disabled' => [false]]);
|
||||
|
||||
it('prints directory details only with the debug option', function () {
|
||||
$entry = directoryEntry() + ['account_control' => 512, 'account_flags' => ['NORMAL_ACCOUNT']];
|
||||
directorySnapshot([$entry]);
|
||||
$this->artisan('ad:sync --email --dry-run')
|
||||
->doesntExpectOutputToContain('AD account')
|
||||
->assertSuccessful();
|
||||
|
||||
directorySnapshot([$entry]);
|
||||
$this->artisan('ad:sync --email --dry-run --debug')
|
||||
->expectsOutput('AD account '.json_encode($entry, JSON_THROW_ON_ERROR))
|
||||
->expectsOutputToContain('created=0')
|
||||
->assertSuccessful();
|
||||
|
||||
expect(User::count())->toBe(0);
|
||||
});
|
||||
|
||||
it('prints LDAP properties separately from normalized account details', function (string $flag) {
|
||||
$properties = ['samaccountname' => ['ada'], 'userprincipalname' => ['[email protected]']];
|
||||
$this->mock(ActiveDirectory::class)->shouldReceive('users')->with(true)->once()
|
||||
->andReturn([directoryEntry() + ['ad_properties' => $properties]]);
|
||||
$this->artisan('ad:sync --email --dry-run '.$flag)
|
||||
->expectsOutput('AD properties '.json_encode($properties, JSON_THROW_ON_ERROR))
|
||||
->doesntExpectOutputToContain('AD account')
|
||||
->assertSuccessful();
|
||||
})->with(['-dd', '--dump-ad']);
|
||||
|
||||
Reference in New Issue
Block a user