diff --git a/plugins/acl/tests/Acl.php b/plugins/acl/tests/Acl.php index 56ae3b5bb..548fff26a 100644 --- a/plugins/acl/tests/Acl.php +++ b/plugins/acl/tests/Acl.php @@ -1,23 +1,23 @@ api); + $plugin = new acl($rcube->plugins); $this->assertInstanceOf('acl', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php b/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php index 55e8c441e..7679af804 100644 --- a/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php +++ b/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php @@ -1,23 +1,23 @@ api); + $plugin = new additional_message_headers($rcube->plugins); $this->assertInstanceOf('additional_message_headers', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/archive/tests/Archive.php b/plugins/archive/tests/Archive.php index 17fcdf7a1..3cdaf1af1 100644 --- a/plugins/archive/tests/Archive.php +++ b/plugins/archive/tests/Archive.php @@ -1,23 +1,23 @@ api); + $plugin = new archive($rcube->plugins); $this->assertInstanceOf('archive', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/autologon/tests/Autologon.php b/plugins/autologon/tests/Autologon.php index f3f6b4206..cd25e7558 100644 --- a/plugins/autologon/tests/Autologon.php +++ b/plugins/autologon/tests/Autologon.php @@ -1,23 +1,23 @@ api); + $plugin = new autologon($rcube->plugins); $this->assertInstanceOf('autologon', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/database_attachments/tests/DatabaseAttachments.php b/plugins/database_attachments/tests/DatabaseAttachments.php index 15ea5f44e..99331d259 100644 --- a/plugins/database_attachments/tests/DatabaseAttachments.php +++ b/plugins/database_attachments/tests/DatabaseAttachments.php @@ -1,23 +1,23 @@ api); + $plugin = new database_attachments($rcube->plugins); $this->assertInstanceOf('database_attachments', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/debug_logger/tests/DebugLogger.php b/plugins/debug_logger/tests/DebugLogger.php index 8dd0c03fe..4438baf78 100644 --- a/plugins/debug_logger/tests/DebugLogger.php +++ b/plugins/debug_logger/tests/DebugLogger.php @@ -1,23 +1,23 @@ api); + $plugin = new debug_logger($rcube->plugins); $this->assertInstanceOf('debug_logger', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/emoticons/tests/Emoticons.php b/plugins/emoticons/tests/Emoticons.php index bc21ceb1d..9bfa42c0a 100644 --- a/plugins/emoticons/tests/Emoticons.php +++ b/plugins/emoticons/tests/Emoticons.php @@ -1,22 +1,22 @@ api); + $plugin = new emoticons($rcube->plugins); $this->assertInstanceOf('emoticons', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/enigma/tests/Enigma.php b/plugins/enigma/tests/Enigma.php index 3972694fc..ada3f8d5b 100644 --- a/plugins/enigma/tests/Enigma.php +++ b/plugins/enigma/tests/Enigma.php @@ -1,23 +1,23 @@ api); + $plugin = new enigma($rcube->plugins); $this->assertInstanceOf('enigma', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/example_addressbook/tests/ExampleAddressbook.php b/plugins/example_addressbook/tests/ExampleAddressbook.php index 762ee7307..dab035572 100644 --- a/plugins/example_addressbook/tests/ExampleAddressbook.php +++ b/plugins/example_addressbook/tests/ExampleAddressbook.php @@ -1,23 +1,23 @@ api); + $plugin = new example_addressbook($rcube->plugins); $this->assertInstanceOf('example_addressbook', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/filesystem_attachments/tests/FilesystemAttachments.php b/plugins/filesystem_attachments/tests/FilesystemAttachments.php index 3b60e12c9..42b7f0685 100644 --- a/plugins/filesystem_attachments/tests/FilesystemAttachments.php +++ b/plugins/filesystem_attachments/tests/FilesystemAttachments.php @@ -1,23 +1,23 @@ api); + $plugin = new filesystem_attachments($rcube->plugins); $this->assertInstanceOf('filesystem_attachments', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/help/tests/Help.php b/plugins/help/tests/Help.php index ff5771bf9..f95da7562 100644 --- a/plugins/help/tests/Help.php +++ b/plugins/help/tests/Help.php @@ -1,23 +1,23 @@ api); + $plugin = new help($rcube->plugins); $this->assertInstanceOf('help', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/hide_blockquote/tests/HideBlockquote.php b/plugins/hide_blockquote/tests/HideBlockquote.php index 90e209459..f4f954463 100644 --- a/plugins/hide_blockquote/tests/HideBlockquote.php +++ b/plugins/hide_blockquote/tests/HideBlockquote.php @@ -1,23 +1,23 @@ api); + $plugin = new hide_blockquote($rcube->plugins); $this->assertInstanceOf('hide_blockquote', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/http_authentication/tests/HttpAuthentication.php b/plugins/http_authentication/tests/HttpAuthentication.php index 5de968d87..4e76b070d 100644 --- a/plugins/http_authentication/tests/HttpAuthentication.php +++ b/plugins/http_authentication/tests/HttpAuthentication.php @@ -1,23 +1,23 @@ api); + $plugin = new http_authentication($rcube->plugins); $this->assertInstanceOf('http_authentication', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/identicon/tests/Identicon.php b/plugins/identicon/tests/Identicon.php index 8dca8aecf..f99a13b90 100644 --- a/plugins/identicon/tests/Identicon.php +++ b/plugins/identicon/tests/Identicon.php @@ -1,22 +1,22 @@ api); + $plugin = new identicon($rcube->plugins); $this->assertInstanceOf('identicon', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/identity_select/tests/IdentitySelect.php b/plugins/identity_select/tests/IdentitySelect.php index 461e79d85..447319a17 100644 --- a/plugins/identity_select/tests/IdentitySelect.php +++ b/plugins/identity_select/tests/IdentitySelect.php @@ -1,22 +1,22 @@ api); + $plugin = new identity_select($rcube->plugins); $this->assertInstanceOf('identity_select', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/jqueryui/tests/Jqueryui.php b/plugins/jqueryui/tests/Jqueryui.php index ee25818ec..ab0dc6232 100644 --- a/plugins/jqueryui/tests/Jqueryui.php +++ b/plugins/jqueryui/tests/Jqueryui.php @@ -1,23 +1,23 @@ api); + $plugin = new jqueryui($rcube->plugins); $this->assertInstanceOf('jqueryui', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/krb_authentication/tests/KrbAuthentication.php b/plugins/krb_authentication/tests/KrbAuthentication.php index f28f5be9d..e1e4d012e 100644 --- a/plugins/krb_authentication/tests/KrbAuthentication.php +++ b/plugins/krb_authentication/tests/KrbAuthentication.php @@ -1,23 +1,23 @@ api); + $plugin = new krb_authentication($rcube->plugins); $this->assertInstanceOf('krb_authentication', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/managesieve/tests/Managesieve.php b/plugins/managesieve/tests/Managesieve.php index 6e930b81d..2cce9473e 100644 --- a/plugins/managesieve/tests/Managesieve.php +++ b/plugins/managesieve/tests/Managesieve.php @@ -1,23 +1,23 @@ api); + $plugin = new managesieve($rcube->plugins); $this->assertInstanceOf('managesieve', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/markasjunk/tests/Markasjunk.php b/plugins/markasjunk/tests/Markasjunk.php index 73494b0ec..dbf337aee 100644 --- a/plugins/markasjunk/tests/Markasjunk.php +++ b/plugins/markasjunk/tests/Markasjunk.php @@ -1,23 +1,23 @@ api); + $plugin = new markasjunk($rcube->plugins); $this->assertInstanceOf('markasjunk', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/new_user_dialog/tests/NewUserDialog.php b/plugins/new_user_dialog/tests/NewUserDialog.php index e58489a09..fdb0c6511 100644 --- a/plugins/new_user_dialog/tests/NewUserDialog.php +++ b/plugins/new_user_dialog/tests/NewUserDialog.php @@ -1,23 +1,23 @@ api); + $plugin = new new_user_dialog($rcube->plugins); $this->assertInstanceOf('new_user_dialog', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/new_user_identity/tests/NewUserIdentity.php b/plugins/new_user_identity/tests/NewUserIdentity.php index 21197362e..beda199e3 100644 --- a/plugins/new_user_identity/tests/NewUserIdentity.php +++ b/plugins/new_user_identity/tests/NewUserIdentity.php @@ -1,23 +1,23 @@ api); + $plugin = new new_user_identity($rcube->plugins); $this->assertInstanceOf('new_user_identity', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/newmail_notifier/tests/NewmailNotifier.php b/plugins/newmail_notifier/tests/NewmailNotifier.php index ccddccd39..3ab6d4142 100644 --- a/plugins/newmail_notifier/tests/NewmailNotifier.php +++ b/plugins/newmail_notifier/tests/NewmailNotifier.php @@ -1,23 +1,23 @@ api); + $plugin = new newmail_notifier($rcube->plugins); $this->assertInstanceOf('newmail_notifier', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/password/tests/Password.php b/plugins/password/tests/Password.php index 95cba4166..a5be3fe69 100644 --- a/plugins/password/tests/Password.php +++ b/plugins/password/tests/Password.php @@ -1,91 +1,91 @@ api); + $plugin = new password($rcube->plugins); $this->assertInstanceOf('password', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } /** * A dummy test testing PHP syntax on password drivers */ function test_all_drivers() { if ($files = glob(__DIR__ . '/../drivers/*.php')) { foreach ($files as $file) { if (preg_match('|/([a-z_]+)\.php$|', $file, $matches)) { $this->load_driver($matches[1]); } } } } /** * cpanel_webmail driver test */ function test_driver_cpanel_webmail() { $driver_class = $this->load_driver('cpanel_webmail'); $error_result = $driver_class::decode_response(false); $this->assertEquals($error_result, PASSWORD_CONNECT_ERROR); $bad_result = $driver_class::decode_response(null); $this->assertEquals($bad_result, PASSWORD_CONNECT_ERROR); $null_result = $driver_class::decode_response('null'); $this->assertEquals($null_result, PASSWORD_ERROR); $malformed_result = $driver_class::decode_response('random {string]!'); $this->assertEquals($malformed_result, PASSWORD_ERROR); $other_result = $driver_class::decode_response('{"a":"b"}'); $this->assertEquals($other_result, PASSWORD_ERROR); $fail_response = '{"data":null,"errors":["Execution of Email::passwdp' . 'op (api version:3) is not permitted inside of webmail"],"sta' . 'tus":0,"metadata":{},"messages":null}'; $error_message = 'Execution of Email::passwdpop (api version:3) is no' . 't permitted inside of webmail'; $expected_result = array( 'code' => PASSWORD_ERROR, 'message' => $error_message ); $fail_result = $driver_class::decode_response($fail_response); $this->assertEquals($expected_result, $fail_result); $success_response = '{"metadata":{},"data":null,"messages":null,"errors' . '":null,"status":1}'; $good_result = $driver_class::decode_response($success_response); $this->assertEquals($good_result, PASSWORD_SUCCESS); } /** * Loads a driver's source file, checks that its class exist and returns the * driver's class name. * * @param string $driver driver name, example: "chpasswd" * @return string driver's class name, example: "rcube_chpasswd_password" */ function load_driver($driver) { include_once __DIR__ . "/../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 53f0c0138..b283f1036 100644 --- a/plugins/redundant_attachments/tests/RedundantAttachments.php +++ b/plugins/redundant_attachments/tests/RedundantAttachments.php @@ -1,23 +1,23 @@ api); + $plugin = new redundant_attachments($rcube->plugins); $this->assertInstanceOf('redundant_attachments', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php b/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php index ab77351a4..803f47f1d 100644 --- a/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php +++ b/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php @@ -1,23 +1,23 @@ api); + $plugin = new show_additional_headers($rcube->plugins); $this->assertInstanceOf('show_additional_headers', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php b/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php index 0e3a5c48a..f28da512b 100644 --- a/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php +++ b/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php @@ -1,23 +1,23 @@ api); + $plugin = new squirrelmail_usercopy($rcube->plugins); $this->assertInstanceOf('squirrelmail_usercopy', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/subscriptions_option/tests/SubscriptionsOption.php b/plugins/subscriptions_option/tests/SubscriptionsOption.php index 10168315e..c8ca50bbb 100644 --- a/plugins/subscriptions_option/tests/SubscriptionsOption.php +++ b/plugins/subscriptions_option/tests/SubscriptionsOption.php @@ -1,23 +1,23 @@ api); + $plugin = new subscriptions_option($rcube->plugins); $this->assertInstanceOf('subscriptions_option', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/userinfo/tests/Userinfo.php b/plugins/userinfo/tests/Userinfo.php index 7eb0758b5..36fa1a389 100644 --- a/plugins/userinfo/tests/Userinfo.php +++ b/plugins/userinfo/tests/Userinfo.php @@ -1,23 +1,23 @@ api); + $plugin = new userinfo($rcube->plugins); $this->assertInstanceOf('userinfo', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/vcard_attachments/tests/VcardAttachments.php b/plugins/vcard_attachments/tests/VcardAttachments.php index 4b37cfc01..0e42f4897 100644 --- a/plugins/vcard_attachments/tests/VcardAttachments.php +++ b/plugins/vcard_attachments/tests/VcardAttachments.php @@ -1,23 +1,23 @@ api); + $plugin = new vcard_attachments($rcube->plugins); $this->assertInstanceOf('vcard_attachments', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/virtuser_file/tests/VirtuserFile.php b/plugins/virtuser_file/tests/VirtuserFile.php index 80feecd15..49eb094fc 100644 --- a/plugins/virtuser_file/tests/VirtuserFile.php +++ b/plugins/virtuser_file/tests/VirtuserFile.php @@ -1,23 +1,23 @@ api); + $plugin = new virtuser_file($rcube->plugins); $this->assertInstanceOf('virtuser_file', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/virtuser_query/tests/VirtuserQuery.php b/plugins/virtuser_query/tests/VirtuserQuery.php index 6c68f4c64..b41372b25 100644 --- a/plugins/virtuser_query/tests/VirtuserQuery.php +++ b/plugins/virtuser_query/tests/VirtuserQuery.php @@ -1,23 +1,23 @@ api); + $plugin = new virtuser_query($rcube->plugins); $this->assertInstanceOf('virtuser_query', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } } diff --git a/plugins/zipdownload/tests/Zipdownload.php b/plugins/zipdownload/tests/Zipdownload.php index 3882dea87..ec83d081a 100644 --- a/plugins/zipdownload/tests/Zipdownload.php +++ b/plugins/zipdownload/tests/Zipdownload.php @@ -1,23 +1,23 @@ api); + $plugin = new zipdownload($rcube->plugins); $this->assertInstanceOf('zipdownload', $plugin); $this->assertInstanceOf('rcube_plugin', $plugin); } }