From: Guilhem Moulin <guilhem@debian.org>
Date: Sun, 10 Jan 2021 23:58:15 +0100
Subject: Adjust test environment for DEP-8 tests

Changes:

 1. Source ‘INSTALL_PATH . 'plugins/…’ rather than ‘__DIR__ . '/../…’ in
    setUp().  This doesn't cause FTBFS but we want to check installed
    code in DEP-8 tests.
 2. Source ‘TESTS_DIR . '../SQL/…’ rather than ‘INSTALL_PATH . '/SQL/…’
    in tests/ActionTestCase.php.  Again, this doesn't cause FTBFS but we
    want to run DEP-8 tests too and the binary packages ship the SQL
    scripts under dbconfig-common not INSTALL_PATH.

Forwarded: not-needed
---
 .github/config-test.inc.php                                         | 2 +-
 plugins/acl/tests/Acl.php                                           | 2 +-
 .../additional_message_headers/tests/AdditionalMessageHeaders.php   | 2 +-
 plugins/archive/tests/Archive.php                                   | 2 +-
 plugins/attachment_reminder/tests/AttachmentReminder.php            | 2 +-
 plugins/autologon/tests/Autologon.php                               | 2 +-
 plugins/autologout/tests/Autologout.php                             | 2 +-
 plugins/database_attachments/tests/DatabaseAttachments.php          | 2 +-
 plugins/debug_logger/tests/DebugLogger.php                          | 2 +-
 plugins/emoticons/tests/Emoticons.php                               | 2 +-
 plugins/enigma/tests/Enigma.php                                     | 2 +-
 plugins/enigma/tests/EnigmaDriverGnupg.php                          | 4 ++--
 plugins/enigma/tests/EnigmaEngine.php                               | 4 ++--
 plugins/enigma/tests/EnigmaError.php                                | 2 +-
 plugins/enigma/tests/EnigmaKey.php                                  | 2 +-
 plugins/enigma/tests/EnigmaMimeMessage.php                          | 2 +-
 plugins/enigma/tests/EnigmaSignature.php                            | 2 +-
 plugins/enigma/tests/EnigmaSubkey.php                               | 2 +-
 plugins/enigma/tests/EnigmaUserid.php                               | 2 +-
 plugins/example_addressbook/tests/ExampleAddressbook.php            | 4 ++--
 plugins/filesystem_attachments/tests/FilesystemAttachments.php      | 2 +-
 plugins/help/tests/Help.php                                         | 2 +-
 plugins/hide_blockquote/tests/HideBlockquote.php                    | 2 +-
 plugins/http_authentication/tests/HttpAuthentication.php            | 2 +-
 plugins/identicon/tests/Identicon.php                               | 2 +-
 plugins/identicon/tests/IdenticonEngine.php                         | 2 +-
 plugins/identity_select/tests/IdentitySelect.php                    | 2 +-
 plugins/jqueryui/tests/Jqueryui.php                                 | 2 +-
 plugins/krb_authentication/tests/KrbAuthentication.php              | 2 +-
 plugins/managesieve/tests/Engine.php                                | 6 +++---
 plugins/managesieve/tests/Forward.php                               | 6 +++---
 plugins/managesieve/tests/Managesieve.php                           | 2 +-
 plugins/managesieve/tests/Script.php                                | 2 +-
 plugins/managesieve/tests/Vacation.php                              | 6 +++---
 plugins/markasjunk/tests/Markasjunk.php                             | 2 +-
 plugins/new_user_dialog/tests/NewUserDialog.php                     | 2 +-
 plugins/new_user_identity/tests/NewUserIdentity.php                 | 2 +-
 plugins/newmail_notifier/tests/NewmailNotifier.php                  | 2 +-
 plugins/password/tests/Password.php                                 | 6 +++---
 plugins/redundant_attachments/tests/RedundantAttachments.php        | 2 +-
 plugins/show_additional_headers/tests/ShowAdditionalHeaders.php     | 2 +-
 plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php        | 2 +-
 plugins/subscriptions_option/tests/SubscriptionsOption.php          | 2 +-
 plugins/userinfo/tests/Userinfo.php                                 | 2 +-
 plugins/vcard_attachments/tests/VcardAttachments.php                | 2 +-
 plugins/virtuser_file/tests/VirtuserFile.php                        | 2 +-
 plugins/virtuser_query/tests/VirtuserQuery.php                      | 2 +-
 plugins/zipdownload/tests/Zipdownload.php                           | 2 +-
 tests/ActionTestCase.php                                            | 2 +-
 49 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/.github/config-test.inc.php b/.github/config-test.inc.php
index 65c6f74..06383a8 100644
--- a/.github/config-test.inc.php
+++ b/.github/config-test.inc.php
@@ -3,7 +3,7 @@
 $config = [];
 
 // Database configuration
-$config['db_dsnw'] = 'sqlite:////tmp/sqlite.db?mode=0646';
+$config['db_dsnw'] = 'sqlite:////tmp/roundcube.db?mode=0600';
 
 // Test user credentials
 $config['tests_username'] = 'test';
diff --git a/plugins/acl/tests/Acl.php b/plugins/acl/tests/Acl.php
index 1206411..94e0bd4 100644
--- a/plugins/acl/tests/Acl.php
+++ b/plugins/acl/tests/Acl.php
@@ -4,7 +4,7 @@ class Acl_Plugin extends ActionTestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../acl.php';
+        include_once INSTALL_PATH . 'plugins/acl/acl.php';
     }
 
     /**
diff --git a/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php b/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
index bd52496..d77c968 100644
--- a/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
+++ b/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
@@ -4,7 +4,7 @@ class AdditionalMessageHeaders_Plugin extends ActionTestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../additional_message_headers.php';
+        include_once INSTALL_PATH . 'plugins/additional_message_headers/additional_message_headers.php';
     }
 
     /**
diff --git a/plugins/archive/tests/Archive.php b/plugins/archive/tests/Archive.php
index 1709134..7f0b9b2 100644
--- a/plugins/archive/tests/Archive.php
+++ b/plugins/archive/tests/Archive.php
@@ -4,7 +4,7 @@ class Archive_Plugin extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../archive.php';
+        include_once INSTALL_PATH . 'plugins/archive/archive.php';
     }
 
     /**
diff --git a/plugins/attachment_reminder/tests/AttachmentReminder.php b/plugins/attachment_reminder/tests/AttachmentReminder.php
index 0e33fae..523fa98 100644
--- a/plugins/attachment_reminder/tests/AttachmentReminder.php
+++ b/plugins/attachment_reminder/tests/AttachmentReminder.php
@@ -4,7 +4,7 @@ class AttachmentReminder_Plugin extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../attachment_reminder.php';
+        include_once INSTALL_PATH . 'plugins/attachment_reminder/attachment_reminder.php';
     }
 
     /**
diff --git a/plugins/autologon/tests/Autologon.php b/plugins/autologon/tests/Autologon.php
index 206867f..7d4135d 100644
--- a/plugins/autologon/tests/Autologon.php
+++ b/plugins/autologon/tests/Autologon.php
@@ -4,7 +4,7 @@ class Autologon_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../autologon.php';
+        include_once INSTALL_PATH . 'plugins/autologon/autologon.php';
     }
 
     /**
diff --git a/plugins/autologout/tests/Autologout.php b/plugins/autologout/tests/Autologout.php
index 20f3ede..a4c633a 100644
--- a/plugins/autologout/tests/Autologout.php
+++ b/plugins/autologout/tests/Autologout.php
@@ -4,7 +4,7 @@ class Autologout_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../autologout.php';
+        include_once INSTALL_PATH . 'plugins/autologout/autologout.php';
     }
 
     /**
diff --git a/plugins/database_attachments/tests/DatabaseAttachments.php b/plugins/database_attachments/tests/DatabaseAttachments.php
index 706dcb8..76d633b 100644
--- a/plugins/database_attachments/tests/DatabaseAttachments.php
+++ b/plugins/database_attachments/tests/DatabaseAttachments.php
@@ -4,7 +4,7 @@ class DatabaseAttachments_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../database_attachments.php';
+        include_once INSTALL_PATH . 'plugins/database_attachments/database_attachments.php';
     }
 
     /**
diff --git a/plugins/debug_logger/tests/DebugLogger.php b/plugins/debug_logger/tests/DebugLogger.php
index 88752eb..d80bcbd 100644
--- a/plugins/debug_logger/tests/DebugLogger.php
+++ b/plugins/debug_logger/tests/DebugLogger.php
@@ -4,7 +4,7 @@ class DebugLogger_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../debug_logger.php';
+        include_once INSTALL_PATH . 'plugins/debug_logger/debug_logger.php';
     }
 
     /**
diff --git a/plugins/emoticons/tests/Emoticons.php b/plugins/emoticons/tests/Emoticons.php
index 9b898fe..31b4568 100644
--- a/plugins/emoticons/tests/Emoticons.php
+++ b/plugins/emoticons/tests/Emoticons.php
@@ -4,7 +4,7 @@ class Emoticons_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../emoticons.php';
+        include_once INSTALL_PATH . 'plugins/emoticons/emoticons.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/Enigma.php b/plugins/enigma/tests/Enigma.php
index 34e4180..b2eb78f 100644
--- a/plugins/enigma/tests/Enigma.php
+++ b/plugins/enigma/tests/Enigma.php
@@ -5,7 +5,7 @@ class Enigma_Plugin extends PHPUnit\Framework\TestCase
 
     function setUp(): void
     {
-        include_once __DIR__ . '/../enigma.php';
+        include_once INSTALL_PATH . 'plugins/enigma/enigma.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaDriverGnupg.php b/plugins/enigma/tests/EnigmaDriverGnupg.php
index 2e18d4d..be7c527 100644
--- a/plugins/enigma/tests/EnigmaDriverGnupg.php
+++ b/plugins/enigma/tests/EnigmaDriverGnupg.php
@@ -4,8 +4,8 @@ class Enigma_EnigmaDriverGnupg extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_driver.php';
-        include_once __DIR__ . '/../lib/enigma_driver_gnupg.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_driver.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_driver_gnupg.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaEngine.php b/plugins/enigma/tests/EnigmaEngine.php
index db70f25..1c80b79 100644
--- a/plugins/enigma/tests/EnigmaEngine.php
+++ b/plugins/enigma/tests/EnigmaEngine.php
@@ -4,8 +4,8 @@ class Enigma_EnigmaEngine extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../enigma.php';
-        include_once __DIR__ . '/../lib/enigma_engine.php';
+        include_once INSTALL_PATH . 'plugins/enigma/enigma.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_engine.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaError.php b/plugins/enigma/tests/EnigmaError.php
index de62c5f..1b226be 100644
--- a/plugins/enigma/tests/EnigmaError.php
+++ b/plugins/enigma/tests/EnigmaError.php
@@ -4,7 +4,7 @@ class Enigma_EnigmaError extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_error.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_error.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaKey.php b/plugins/enigma/tests/EnigmaKey.php
index 2a5acd2..4f139a5 100644
--- a/plugins/enigma/tests/EnigmaKey.php
+++ b/plugins/enigma/tests/EnigmaKey.php
@@ -4,7 +4,7 @@ class Enigma_EnigmaKey extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_key.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_key.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaMimeMessage.php b/plugins/enigma/tests/EnigmaMimeMessage.php
index f65ae84..06c905f 100644
--- a/plugins/enigma/tests/EnigmaMimeMessage.php
+++ b/plugins/enigma/tests/EnigmaMimeMessage.php
@@ -4,7 +4,7 @@ class Enigma_EnigmaMimeMessage extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_mime_message.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_mime_message.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaSignature.php b/plugins/enigma/tests/EnigmaSignature.php
index 73929d1..1db5d61 100644
--- a/plugins/enigma/tests/EnigmaSignature.php
+++ b/plugins/enigma/tests/EnigmaSignature.php
@@ -4,7 +4,7 @@ class Enigma_EnigmaSignature extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_signature.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_signature.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaSubkey.php b/plugins/enigma/tests/EnigmaSubkey.php
index 05b61eb..9074706 100644
--- a/plugins/enigma/tests/EnigmaSubkey.php
+++ b/plugins/enigma/tests/EnigmaSubkey.php
@@ -4,7 +4,7 @@ class Enigma_EnigmaSubkey extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_subkey.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_subkey.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/EnigmaUserid.php b/plugins/enigma/tests/EnigmaUserid.php
index bb3bf7f..90221bf 100644
--- a/plugins/enigma/tests/EnigmaUserid.php
+++ b/plugins/enigma/tests/EnigmaUserid.php
@@ -4,7 +4,7 @@ class Enigma_EnigmaUserid extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/enigma_userid.php';
+        include_once INSTALL_PATH . 'plugins/enigma/lib/enigma_userid.php';
     }
 
     /**
diff --git a/plugins/example_addressbook/tests/ExampleAddressbook.php b/plugins/example_addressbook/tests/ExampleAddressbook.php
index 3e6c191..30bb786 100644
--- a/plugins/example_addressbook/tests/ExampleAddressbook.php
+++ b/plugins/example_addressbook/tests/ExampleAddressbook.php
@@ -4,8 +4,8 @@ class ExampleAddressbook_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../example_addressbook.php';
-        include_once __DIR__ . '/../example_addressbook_backend.php';
+        include_once INSTALL_PATH . 'plugins/example_addressbook/example_addressbook.php';
+        include_once INSTALL_PATH . 'plugins/example_addressbook/example_addressbook_backend.php';
     }
 
     /**
diff --git a/plugins/filesystem_attachments/tests/FilesystemAttachments.php b/plugins/filesystem_attachments/tests/FilesystemAttachments.php
index 0fe6e4a..3ff710c 100644
--- a/plugins/filesystem_attachments/tests/FilesystemAttachments.php
+++ b/plugins/filesystem_attachments/tests/FilesystemAttachments.php
@@ -4,7 +4,7 @@ class FilesystemAttachments_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../filesystem_attachments.php';
+        include_once INSTALL_PATH . 'plugins/filesystem_attachments/filesystem_attachments.php';
     }
 
     /**
diff --git a/plugins/help/tests/Help.php b/plugins/help/tests/Help.php
index 21327cb..69576ae 100644
--- a/plugins/help/tests/Help.php
+++ b/plugins/help/tests/Help.php
@@ -4,7 +4,7 @@ class Help_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../help.php';
+        include_once INSTALL_PATH . 'plugins/help/help.php';
     }
 
     /**
diff --git a/plugins/hide_blockquote/tests/HideBlockquote.php b/plugins/hide_blockquote/tests/HideBlockquote.php
index 364d658..c8f2885 100644
--- a/plugins/hide_blockquote/tests/HideBlockquote.php
+++ b/plugins/hide_blockquote/tests/HideBlockquote.php
@@ -4,7 +4,7 @@ class HideBlockquote_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../hide_blockquote.php';
+        include_once INSTALL_PATH . 'plugins/hide_blockquote/hide_blockquote.php';
     }
 
     /**
diff --git a/plugins/http_authentication/tests/HttpAuthentication.php b/plugins/http_authentication/tests/HttpAuthentication.php
index ad10258..dc3aee5 100644
--- a/plugins/http_authentication/tests/HttpAuthentication.php
+++ b/plugins/http_authentication/tests/HttpAuthentication.php
@@ -4,7 +4,7 @@ class HttpAuthentication_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../http_authentication.php';
+        include_once INSTALL_PATH . 'plugins/http_authentication/http_authentication.php';
     }
 
     /**
diff --git a/plugins/identicon/tests/Identicon.php b/plugins/identicon/tests/Identicon.php
index 777cfe5..03bf2c3 100644
--- a/plugins/identicon/tests/Identicon.php
+++ b/plugins/identicon/tests/Identicon.php
@@ -4,7 +4,7 @@ class Identicon_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeCLass(): void
     {
-        include_once __DIR__ . '/../identicon.php';
+        include_once INSTALL_PATH . 'plugins/identicon/identicon.php';
     }
 
     /**
diff --git a/plugins/identicon/tests/IdenticonEngine.php b/plugins/identicon/tests/IdenticonEngine.php
index 88f3a82..810805e 100644
--- a/plugins/identicon/tests/IdenticonEngine.php
+++ b/plugins/identicon/tests/IdenticonEngine.php
@@ -4,7 +4,7 @@ class Identicon_IdenticonEngine extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../identicon_engine.php';
+        include_once INSTALL_PATH . 'plugins/identicon/identicon_engine.php';
     }
 
     /**
diff --git a/plugins/identity_select/tests/IdentitySelect.php b/plugins/identity_select/tests/IdentitySelect.php
index e9b63e2..52038fb 100644
--- a/plugins/identity_select/tests/IdentitySelect.php
+++ b/plugins/identity_select/tests/IdentitySelect.php
@@ -4,7 +4,7 @@ class IdentitySelect_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../identity_select.php';
+        include_once INSTALL_PATH . 'plugins/identity_select/identity_select.php';
     }
 
     /**
diff --git a/plugins/jqueryui/tests/Jqueryui.php b/plugins/jqueryui/tests/Jqueryui.php
index f6dfd73..b2361a0 100644
--- a/plugins/jqueryui/tests/Jqueryui.php
+++ b/plugins/jqueryui/tests/Jqueryui.php
@@ -4,7 +4,7 @@ class Jqueryui_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../jqueryui.php';
+        include_once INSTALL_PATH . 'plugins/jqueryui/jqueryui.php';
     }
 
     /**
diff --git a/plugins/krb_authentication/tests/KrbAuthentication.php b/plugins/krb_authentication/tests/KrbAuthentication.php
index b4424a9..8bcff76 100644
--- a/plugins/krb_authentication/tests/KrbAuthentication.php
+++ b/plugins/krb_authentication/tests/KrbAuthentication.php
@@ -4,7 +4,7 @@ class KrbAuthentication_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../krb_authentication.php';
+        include_once INSTALL_PATH . 'plugins/krb_authentication/krb_authentication.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Engine.php b/plugins/managesieve/tests/Engine.php
index 01e0565..c66c5f7 100644
--- a/plugins/managesieve/tests/Engine.php
+++ b/plugins/managesieve/tests/Engine.php
@@ -4,9 +4,9 @@ class Managesieve_Engine extends ActionTestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../managesieve.php';
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_engine.php';
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_vacation.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/managesieve.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_vacation.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Forward.php b/plugins/managesieve/tests/Forward.php
index e1271f5..00d3211 100644
--- a/plugins/managesieve/tests/Forward.php
+++ b/plugins/managesieve/tests/Forward.php
@@ -4,9 +4,9 @@ class Managesieve_Forward extends ActionTestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../managesieve.php';
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_engine.php';
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_forward.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/managesieve.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_forward.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Managesieve.php b/plugins/managesieve/tests/Managesieve.php
index c671bb1..d54531b 100644
--- a/plugins/managesieve/tests/Managesieve.php
+++ b/plugins/managesieve/tests/Managesieve.php
@@ -5,7 +5,7 @@ class Managesieve_Plugin extends PHPUnit\Framework\TestCase
 
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../managesieve.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/managesieve.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Script.php b/plugins/managesieve/tests/Script.php
index 897a93f..0c2c034 100644
--- a/plugins/managesieve/tests/Script.php
+++ b/plugins/managesieve/tests/Script.php
@@ -4,7 +4,7 @@ class Managesieve_Script extends PHPUnit\Framework\TestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_script.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_script.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Vacation.php b/plugins/managesieve/tests/Vacation.php
index 3a5c638..9016f64 100644
--- a/plugins/managesieve/tests/Vacation.php
+++ b/plugins/managesieve/tests/Vacation.php
@@ -4,9 +4,9 @@ class Managesieve_Vacation extends ActionTestCase
 {
     static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../managesieve.php';
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_engine.php';
-        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_vacation.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/managesieve.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php';
+        include_once INSTALL_PATH . 'plugins/managesieve/lib/Roundcube/rcube_sieve_vacation.php';
     }
 
     /**
diff --git a/plugins/markasjunk/tests/Markasjunk.php b/plugins/markasjunk/tests/Markasjunk.php
index 6c51da9..d10407e 100644
--- a/plugins/markasjunk/tests/Markasjunk.php
+++ b/plugins/markasjunk/tests/Markasjunk.php
@@ -4,7 +4,7 @@ class Markasjunk_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../markasjunk.php';
+        include_once INSTALL_PATH . 'plugins/markasjunk/markasjunk.php';
     }
 
     /**
diff --git a/plugins/new_user_dialog/tests/NewUserDialog.php b/plugins/new_user_dialog/tests/NewUserDialog.php
index 992df32..2e3bf1f 100644
--- a/plugins/new_user_dialog/tests/NewUserDialog.php
+++ b/plugins/new_user_dialog/tests/NewUserDialog.php
@@ -4,7 +4,7 @@ class NewUserDialog_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../new_user_dialog.php';
+        include_once INSTALL_PATH . 'plugins/new_user_dialog/new_user_dialog.php';
     }
 
     /**
diff --git a/plugins/new_user_identity/tests/NewUserIdentity.php b/plugins/new_user_identity/tests/NewUserIdentity.php
index 463b9a1..94077a3 100644
--- a/plugins/new_user_identity/tests/NewUserIdentity.php
+++ b/plugins/new_user_identity/tests/NewUserIdentity.php
@@ -4,7 +4,7 @@ class NewUserIdentity_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../new_user_identity.php';
+        include_once INSTALL_PATH . 'plugins/new_user_identity/new_user_identity.php';
     }
 
     /**
diff --git a/plugins/newmail_notifier/tests/NewmailNotifier.php b/plugins/newmail_notifier/tests/NewmailNotifier.php
index 6d646dd..6026f04 100644
--- a/plugins/newmail_notifier/tests/NewmailNotifier.php
+++ b/plugins/newmail_notifier/tests/NewmailNotifier.php
@@ -4,7 +4,7 @@ class NewmailNotifier_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../newmail_notifier.php';
+        include_once INSTALL_PATH . 'plugins/newmail_notifier/newmail_notifier.php';
     }
 
     /**
diff --git a/plugins/password/tests/Password.php b/plugins/password/tests/Password.php
index 48b5502..4a37c91 100644
--- a/plugins/password/tests/Password.php
+++ b/plugins/password/tests/Password.php
@@ -4,7 +4,7 @@ class Password_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../password.php';
+        include_once INSTALL_PATH . 'plugins/password/password.php';
     }
 
     /**
@@ -24,7 +24,7 @@ class Password_Plugin extends PHPUnit\Framework\TestCase
      */
     function test_all_drivers()
     {
-        if ($files = glob(__DIR__ . '/../drivers/*.php')) {
+        if ($files = glob(INSTALL_PATH . 'plugins/password/drivers/*.php')) {
             foreach ($files as $file) {
                 if (preg_match('|/([a-z_]+)\.php$|', $file, $matches)) {
                     $this->load_driver($matches[1]);
@@ -82,7 +82,7 @@ class Password_Plugin extends PHPUnit\Framework\TestCase
      */
     function load_driver($driver)
     {
-        include_once __DIR__ . "/../drivers/$driver.php";
+        include_once INSTALL_PATH . "plugins/password/drivers/$driver.php";
         $driver_class = "rcube_{$driver}_password";
         $this->assertTrue(class_exists($driver_class));
         return $driver_class;
diff --git a/plugins/redundant_attachments/tests/RedundantAttachments.php b/plugins/redundant_attachments/tests/RedundantAttachments.php
index 274c129..1ac6c50 100644
--- a/plugins/redundant_attachments/tests/RedundantAttachments.php
+++ b/plugins/redundant_attachments/tests/RedundantAttachments.php
@@ -4,7 +4,7 @@ class RedundantAttachments_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../redundant_attachments.php';
+        include_once INSTALL_PATH . 'plugins/redundant_attachments/redundant_attachments.php';
     }
 
     /**
diff --git a/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php b/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
index 21337bc..6374ec7 100644
--- a/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
+++ b/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
@@ -4,7 +4,7 @@ class ShowAdditionalHeaders_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../show_additional_headers.php';
+        include_once INSTALL_PATH . 'plugins/show_additional_headers/show_additional_headers.php';
     }
 
     /**
diff --git a/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php b/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
index 13b75c0..1e645dd 100644
--- a/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
+++ b/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
@@ -4,7 +4,7 @@ class SquirrelmailUsercopy_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../squirrelmail_usercopy.php';
+        include_once INSTALL_PATH . 'plugins/squirrelmail_usercopy/squirrelmail_usercopy.php';
     }
 
     /**
diff --git a/plugins/subscriptions_option/tests/SubscriptionsOption.php b/plugins/subscriptions_option/tests/SubscriptionsOption.php
index df54794..6af745f 100644
--- a/plugins/subscriptions_option/tests/SubscriptionsOption.php
+++ b/plugins/subscriptions_option/tests/SubscriptionsOption.php
@@ -4,7 +4,7 @@ class SubscriptionsOption_Plugin extends ActionTestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../subscriptions_option.php';
+        include_once INSTALL_PATH . 'plugins/subscriptions_option/subscriptions_option.php';
     }
 
     /**
diff --git a/plugins/userinfo/tests/Userinfo.php b/plugins/userinfo/tests/Userinfo.php
index 49d0201..2f6b90e 100644
--- a/plugins/userinfo/tests/Userinfo.php
+++ b/plugins/userinfo/tests/Userinfo.php
@@ -4,7 +4,7 @@ class Userinfo_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../userinfo.php';
+        include_once INSTALL_PATH . 'plugins/userinfo/userinfo.php';
     }
 
     /**
diff --git a/plugins/vcard_attachments/tests/VcardAttachments.php b/plugins/vcard_attachments/tests/VcardAttachments.php
index 4008a3f..e716554 100644
--- a/plugins/vcard_attachments/tests/VcardAttachments.php
+++ b/plugins/vcard_attachments/tests/VcardAttachments.php
@@ -4,7 +4,7 @@ class VcardAttachments_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../vcard_attachments.php';
+        include_once INSTALL_PATH . 'plugins/vcard_attachments/vcard_attachments.php';
     }
 
     /**
diff --git a/plugins/virtuser_file/tests/VirtuserFile.php b/plugins/virtuser_file/tests/VirtuserFile.php
index 7d575a5..e021b68 100644
--- a/plugins/virtuser_file/tests/VirtuserFile.php
+++ b/plugins/virtuser_file/tests/VirtuserFile.php
@@ -4,7 +4,7 @@ class VirtuserFile_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../virtuser_file.php';
+        include_once INSTALL_PATH . 'plugins/virtuser_file/virtuser_file.php';
     }
 
     /**
diff --git a/plugins/virtuser_query/tests/VirtuserQuery.php b/plugins/virtuser_query/tests/VirtuserQuery.php
index d8ccb7b..c7cf10e 100644
--- a/plugins/virtuser_query/tests/VirtuserQuery.php
+++ b/plugins/virtuser_query/tests/VirtuserQuery.php
@@ -4,7 +4,7 @@ class VirtuserQuery_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../virtuser_query.php';
+        include_once INSTALL_PATH . 'plugins/virtuser_query/virtuser_query.php';
     }
 
     /**
diff --git a/plugins/zipdownload/tests/Zipdownload.php b/plugins/zipdownload/tests/Zipdownload.php
index 2e6115f..d355b38 100644
--- a/plugins/zipdownload/tests/Zipdownload.php
+++ b/plugins/zipdownload/tests/Zipdownload.php
@@ -4,7 +4,7 @@ class Zipdownload_Plugin extends PHPUnit\Framework\TestCase
 {
     public static function setUpBeforeClass(): void
     {
-        include_once __DIR__ . '/../zipdownload.php';
+        include_once INSTALL_PATH . 'plugins/zipdownload/zipdownload.php';
     }
 
     /**
diff --git a/tests/ActionTestCase.php b/tests/ActionTestCase.php
index b897ced..4fb1288 100644
--- a/tests/ActionTestCase.php
+++ b/tests/ActionTestCase.php
@@ -106,7 +106,7 @@ class ActionTestCase extends PHPUnit\Framework\TestCase
 
             // init database with schema
             system(sprintf('cat %s %s | mysql -h %s -u %s --password=%s %s',
-                realpath(INSTALL_PATH . '/SQL/mysql.initial.sql'),
+                realpath(TESTS_DIR . '../SQL/mysql.initial.sql'),
                 realpath(TESTS_DIR . 'src/sql/init.sql'),
                 escapeshellarg($dsn['hostspec']),
                 escapeshellarg($dsn['username']),
