-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't use global variables any more (#4)
- Loading branch information
David Coutadeur
committed
Apr 2, 2024
1 parent
70eacb6
commit 13958b9
Showing
4 changed files
with
158 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ public function test_ldap_get_mail_for_notification(): void | |
{ | ||
|
||
// global variable for ldap_get_mail_for_notification function | ||
$GLOBALS['mail_attributes'] = array("mail"); | ||
$mail_attributes = array("mail"); | ||
|
||
$phpLDAPMock = Mockery::mock('overload:Ltb\PhpLDAP'); | ||
$phpLDAPMock->shouldreceive([ | ||
|
@@ -59,15 +59,15 @@ public function test_ldap_get_mail_for_notification(): void | |
]); | ||
|
||
# Test ldap_get_mail_for_notification | ||
$mail = Ltb\AttributeValue::ldap_get_mail_for_notification(null, null); | ||
$mail = Ltb\AttributeValue::ldap_get_mail_for_notification(null, null, $mail_attributes); | ||
$this->assertEquals('[email protected]', $mail, "not getting [email protected] as mail for notification"); | ||
} | ||
|
||
public function test_ldap_get_proxy_for_notification(): void | ||
{ | ||
|
||
// global variable for ldap_get_mail_for_notification function | ||
$GLOBALS['mail_attributes'] = array("proxyAddresses"); | ||
$mail_attributes = array("proxyAddresses"); | ||
|
||
$phpLDAPMock = Mockery::mock('overload:Ltb\PhpLDAP'); | ||
$phpLDAPMock->shouldreceive([ | ||
|
@@ -80,7 +80,7 @@ public function test_ldap_get_proxy_for_notification(): void | |
]); | ||
|
||
# Test ldap_get_mail_for_notification | ||
$mail = Ltb\AttributeValue::ldap_get_mail_for_notification(null, null); | ||
$mail = Ltb\AttributeValue::ldap_get_mail_for_notification(null, null, $mail_attributes); | ||
$this->assertEquals('[email protected]', $mail, "not getting [email protected] as proxyAddress for notification"); | ||
} | ||
|
||
|
Oops, something went wrong.