mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Fixed tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
3705b91439
commit
710e738e8e
|
@ -22,10 +22,16 @@ class LdapSettingsTest extends TestCase
|
||||||
'ldap_enabled' => 1,
|
'ldap_enabled' => 1,
|
||||||
'ldap_username_field' => 'samaccountname',
|
'ldap_username_field' => 'samaccountname',
|
||||||
'ldap_filter' => 'uid=',
|
'ldap_filter' => 'uid=',
|
||||||
|
'ldap_auth_filter_query' => 'uid=',
|
||||||
|
'ldap_uname' => 'SomeUserField',
|
||||||
|
'ldap_pword' => 'MyAwesomePassword',
|
||||||
|
'ldap_basedn' => 'uid=',
|
||||||
|
'ldap_fname_field' => 'SomeFirstnameField',
|
||||||
|
'ldap_server' => 'ldaps://ldap.example.com',
|
||||||
]))
|
]))
|
||||||
->assertStatus(302)
|
->assertStatus(302)
|
||||||
->assertValid('ldap_enabled')
|
->assertValid('ldap_enabled')
|
||||||
->assertRedirect(route('settings.index'))
|
->assertRedirect(route('settings.ldap.index'))
|
||||||
->assertSessionHasNoErrors();
|
->assertSessionHasNoErrors();
|
||||||
$this->followRedirects($response)->assertSee('alert-success');
|
$this->followRedirects($response)->assertSee('alert-success');
|
||||||
}
|
}
|
||||||
|
@ -37,11 +43,19 @@ class LdapSettingsTest extends TestCase
|
||||||
->post(route('settings.ldap.save', [
|
->post(route('settings.ldap.save', [
|
||||||
'ldap_enabled' => 1,
|
'ldap_enabled' => 1,
|
||||||
'ldap_username_field' => 'sAMAccountName',
|
'ldap_username_field' => 'sAMAccountName',
|
||||||
'ldap_filter' => 'uid=',
|
'ldap_filter' => '(uid=)',
|
||||||
]))
|
]))
|
||||||
->assertStatus(302)
|
->assertStatus(302)
|
||||||
->assertRedirect(route('settings.ldap.index'))
|
->assertRedirect(route('settings.ldap.index'))
|
||||||
->assertSessionHasErrors();
|
->assertSessionHasErrors([
|
||||||
|
'ldap_username_field',
|
||||||
|
'ldap_auth_filter_query',
|
||||||
|
'ldap_uname',
|
||||||
|
'ldap_pword',
|
||||||
|
'ldap_basedn',
|
||||||
|
'ldap_fname_field',
|
||||||
|
'ldap_server',
|
||||||
|
]);
|
||||||
$this->followRedirects($response)->assertSee('alert-danger');
|
$this->followRedirects($response)->assertSee('alert-danger');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue