aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-10-18 12:04:22 +0200
committerprovokateurin <kate@provokateurin.de>2024-10-21 12:37:59 +0200
commit381077028adf388a7081cf42026570c6be47b198 (patch)
treec0f8e9b6caea80d6b55d6fdcc9188ba57197fa0f /apps/user_ldap/tests
parent4d8d11d2f79da348644e0902e78a2f000498cd52 (diff)
downloadnextcloud-server-381077028adf388a7081cf42026570c6be47b198.tar.gz
nextcloud-server-381077028adf388a7081cf42026570c6be47b198.zip
refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/Integration/AbstractIntegrationTest.php15
-rw-r--r--apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php37
2 files changed, 21 insertions, 31 deletions
diff --git a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
index 30b3e573cd4..726342a88f7 100644
--- a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
+++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php
@@ -37,14 +37,19 @@ abstract class AbstractIntegrationTest {
/** @var Helper */
protected $helper;
- /** @var string */
- protected $base;
-
/** @var string[] */
protected $server;
- public function __construct($host, $port, $bind, $pwd, $base) {
- $this->base = $base;
+ /**
+ * @param string $base
+ */
+ public function __construct(
+ $host,
+ $port,
+ $bind,
+ $pwd,
+ protected $base,
+ ) {
$this->server = [
'host' => $host,
'port' => $port,
diff --git a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
index 2beab95b71f..78f6df9d7bc 100644
--- a/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
+++ b/apps/user_ldap/tests/Integration/ExceptionOnLostConnection.php
@@ -22,21 +22,6 @@ use OCA\User_LDAP\LDAP;
*/
class ExceptionOnLostConnection {
/** @var string */
- private $toxiProxyHost;
-
- /** @var string */
- private $toxiProxyName;
-
- /** @var string */
- private $ldapBase;
-
- /** @var string|null */
- private $ldapBindDN;
-
- /** @var string|null */
- private $ldapBindPwd;
-
- /** @var string */
private $ldapHost;
/** @var LDAP */
@@ -46,19 +31,19 @@ class ExceptionOnLostConnection {
private $originalProxyState;
/**
- * @param string $proxyHost host of toxiproxy as url, like http://localhost:8474
- * @param string $proxyName name of the LDAP proxy service as configured in toxiProxy
+ * @param string $toxiProxyHost host of toxiproxy as url, like http://localhost:8474
+ * @param string $toxiProxyName name of the LDAP proxy service as configured in toxiProxy
* @param string $ldapBase any valid LDAP base DN
- * @param null $bindDN optional, bind DN if anonymous bind is not possible
- * @param null $bindPwd optional
+ * @param null $ldapBindDN optional, bind DN if anonymous bind is not possible
+ * @param null $ldapBindPwd optional
*/
- public function __construct($proxyHost, $proxyName, $ldapBase, $bindDN = null, $bindPwd = null) {
- $this->toxiProxyHost = $proxyHost;
- $this->toxiProxyName = $proxyName;
- $this->ldapBase = $ldapBase;
- $this->ldapBindDN = $bindDN;
- $this->ldapBindPwd = $bindPwd;
-
+ public function __construct(
+ private $toxiProxyHost,
+ private $toxiProxyName,
+ private $ldapBase,
+ private $ldapBindDN = null,
+ private $ldapBindPwd = null,
+ ) {
$this->setUp();
}