Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add basic tests for plugins

  • Loading branch information...
commit b005927f919cbc09dccf71e8c638be45a8af37d0 1 parent 7ae7cdf
Aleksander Machniak alecpl authored

Showing 32 changed files with 707 additions and 4 deletions. Show diff stats Hide diff stats

  1. +23 0 plugins/acl/tests/Acl.php
  2. +23 0 plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
  3. +23 0 plugins/archive/tests/Archive.php
  4. +23 0 plugins/autologon/tests/Autologon.php
  5. +23 0 plugins/database_attachments/tests/DatabaseAttachments.php
  6. +4 3 plugins/debug_logger/debug_logger.php
  7. +23 0 plugins/debug_logger/tests/DebugLogger.php
  8. +23 0 plugins/emoticons/tests/Emoticons.php
  9. +23 0 plugins/enigma/tests/Enigma.php
  10. +23 0 plugins/example_addressbook/tests/ExampleAddressbook.php
  11. +23 0 plugins/filesystem_attachments/tests/FilesystemAttachments.php
  12. +23 0 plugins/help/tests/Help.php
  13. +23 0 plugins/hide_blockquote/tests/HideBlockquote.php
  14. +23 0 plugins/http_authentication/tests/HttpAuthentication.php
  15. +23 0 plugins/jqueryui/tests/Jqueryui.php
  16. +23 0 plugins/managesieve/tests/Managesieve.php
  17. +23 0 plugins/markasjunk/tests/Markasjunk.php
  18. +23 0 plugins/new_user_dialog/tests/NewUserDialog.php
  19. +23 0 plugins/new_user_identity/tests/NewUserIdentity.php
  20. +23 0 plugins/newmail_notifier/tests/NewmailNotifier.php
  21. +23 0 plugins/password/tests/Password.php
  22. +23 0 plugins/redundant_attachments/tests/RedundantAttachments.php
  23. +23 0 plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
  24. +23 0 plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
  25. +23 0 plugins/subscriptions_option/tests/SubscriptionsOption.php
  26. +23 0 plugins/userinfo/tests/Userinfo.php
  27. +23 0 plugins/vcard_attachments/tests/VcardAttachments.php
  28. +23 0 plugins/virtuser_file/tests/VirtuserFile.php
  29. +23 0 plugins/virtuser_query/tests/VirtuserQuery.php
  30. +23 0 plugins/zipdownload/tests/Zipdownload.php
  31. +6 0 tests/bootstrap.php
  32. +30 1 tests/phpunit.xml
23 plugins/acl/tests/Acl.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Acl_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../acl.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new acl($rcube->api);
  18 +
  19 + $this->assertInstanceOf('acl', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class AdditionalMessageHeaders_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../additional_message_headers.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new additional_message_headers($rcube->api);
  18 +
  19 + $this->assertInstanceOf('additional_message_headers', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/archive/tests/Archive.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Archive_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../archive.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new archive($rcube->api);
  18 +
  19 + $this->assertInstanceOf('archive', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/autologon/tests/Autologon.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Autologon_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../autologon.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new autologon($rcube->api);
  18 +
  19 + $this->assertInstanceOf('autologon', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/database_attachments/tests/DatabaseAttachments.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class DatabaseAttachments_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../database_attachments.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new database_attachments($rcube->api);
  18 +
  19 + $this->assertInstanceOf('database_attachments', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
7 plugins/debug_logger/debug_logger.php
@@ -142,8 +142,9 @@ function console($args){
142 142 return $args;
143 143 }
144 144
145   - function __destruct(){
146   - $this->runlog->end();
  145 + function __destruct()
  146 + {
  147 + if ($this->runlog)
  148 + $this->runlog->end();
147 149 }
148 150 }
149   -?>
23 plugins/debug_logger/tests/DebugLogger.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class DebugLogger_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../debug_logger.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new debug_logger($rcube->api);
  18 +
  19 + $this->assertInstanceOf('debug_logger', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/emoticons/tests/Emoticons.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Emoticons_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../emoticons.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new emoticons($rcube->api);
  18 +
  19 + $this->assertInstanceOf('emoticons', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/enigma/tests/Enigma.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Enigma_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../enigma.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new enigma($rcube->api);
  18 +
  19 + $this->assertInstanceOf('enigma', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/example_addressbook/tests/ExampleAddressbook.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class ExampleAddressbook_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../example_addressbook.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new example_addressbook($rcube->api);
  18 +
  19 + $this->assertInstanceOf('example_addressbook', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/filesystem_attachments/tests/FilesystemAttachments.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class FilesystemAttachments_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../filesystem_attachments.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new filesystem_attachments($rcube->api);
  18 +
  19 + $this->assertInstanceOf('filesystem_attachments', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/help/tests/Help.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Help_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../help.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new help($rcube->api);
  18 +
  19 + $this->assertInstanceOf('help', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/hide_blockquote/tests/HideBlockquote.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class HideBlockquote_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../hide_blockquote.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new hide_blockquote($rcube->api);
  18 +
  19 + $this->assertInstanceOf('hide_blockquote', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/http_authentication/tests/HttpAuthentication.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class HttpAuthentication_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../http_authentication.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new http_authentication($rcube->api);
  18 +
  19 + $this->assertInstanceOf('http_authentication', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/jqueryui/tests/Jqueryui.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Jqueryui_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../jqueryui.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new jqueryui($rcube->api);
  18 +
  19 + $this->assertInstanceOf('jqueryui', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/managesieve/tests/Managesieve.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Managesieve_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../managesieve.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new managesieve($rcube->api);
  18 +
  19 + $this->assertInstanceOf('managesieve', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/markasjunk/tests/Markasjunk.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Markasjunk_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../markasjunk.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new markasjunk($rcube->api);
  18 +
  19 + $this->assertInstanceOf('markasjunk', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/new_user_dialog/tests/NewUserDialog.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class NewUserDialog_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../new_user_dialog.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new new_user_dialog($rcube->api);
  18 +
  19 + $this->assertInstanceOf('new_user_dialog', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/new_user_identity/tests/NewUserIdentity.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class NewUserIdentity_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../new_user_identity.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new new_user_identity($rcube->api);
  18 +
  19 + $this->assertInstanceOf('new_user_identity', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/newmail_notifier/tests/NewmailNotifier.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class NewmailNotifier_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../newmail_notifier.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new newmail_notifier($rcube->api);
  18 +
  19 + $this->assertInstanceOf('newmail_notifier', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/password/tests/Password.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Password_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../password.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new password($rcube->api);
  18 +
  19 + $this->assertInstanceOf('password', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/redundant_attachments/tests/RedundantAttachments.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class RedundantAttachments_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../redundant_attachments.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new redundant_attachments($rcube->api);
  18 +
  19 + $this->assertInstanceOf('redundant_attachments', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class ShowAdditionalHeaders_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../show_additional_headers.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new show_additional_headers($rcube->api);
  18 +
  19 + $this->assertInstanceOf('show_additional_headers', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class SquirrelmailUsercopy_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../squirrelmail_usercopy.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new squirrelmail_usercopy($rcube->api);
  18 +
  19 + $this->assertInstanceOf('squirrelmail_usercopy', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/subscriptions_option/tests/SubscriptionsOption.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class SubscriptionsOption_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../subscriptions_option.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new subscriptions_option($rcube->api);
  18 +
  19 + $this->assertInstanceOf('subscriptions_option', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/userinfo/tests/Userinfo.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Userinfo_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../userinfo.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new userinfo($rcube->api);
  18 +
  19 + $this->assertInstanceOf('userinfo', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/vcard_attachments/tests/VcardAttachments.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class VcardAttachments_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../vcard_attachments.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new vcard_attachments($rcube->api);
  18 +
  19 + $this->assertInstanceOf('vcard_attachments', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/virtuser_file/tests/VirtuserFile.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class VirtuserFile_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../virtuser_file.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new virtuser_file($rcube->api);
  18 +
  19 + $this->assertInstanceOf('virtuser_file', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/virtuser_query/tests/VirtuserQuery.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class VirtuserQuery_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../virtuser_query.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new virtuser_query($rcube->api);
  18 +
  19 + $this->assertInstanceOf('virtuser_query', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
23 plugins/zipdownload/tests/Zipdownload.php
... ... @@ -0,0 +1,23 @@
  1 +<?php
  2 +
  3 +class Zipdownload_Plugin extends PHPUnit_Framework_TestCase
  4 +{
  5 +
  6 + function setUp()
  7 + {
  8 + include_once dirname(__FILE__) . '/../zipdownload.php';
  9 + }
  10 +
  11 + /**
  12 + * Plugin object construction test
  13 + */
  14 + function test_constructor()
  15 + {
  16 + $rcube = rcube::get_instance();
  17 + $plugin = new zipdownload($rcube->api);
  18 +
  19 + $this->assertInstanceOf('zipdownload', $plugin);
  20 + $this->assertInstanceOf('rcube_plugin', $plugin);
  21 + }
  22 +}
  23 +
6 tests/bootstrap.php
@@ -33,3 +33,9 @@
33 33 require_once(INSTALL_PATH . 'program/include/iniset.php');
34 34
35 35 rcmail::get_instance()->config->set('devel_mode', false);
  36 +
  37 +// Extend include path so some plugin test won't fail
  38 +$include_path = ini_get('include_path') . PATH_SEPARATOR . TESTS_DIR . '..';
  39 +if (set_include_path($include_path) === false) {
  40 + die("Fatal error: ini_set/set_include_path does not work.");
  41 +}
31 tests/phpunit.xml
@@ -32,9 +32,38 @@
32 32 <file>Framework/Washtml.php</file>
33 33 <file>MailFunc.php</file>
34 34 </testsuite>
35   - <testsuite name="Managesieve Tests">
  35 + <testsuite name="Plugins Tests">
  36 + <file>./../plugins/acl/tests/Acl.php</file>
  37 + <file>./../plugins/additional_message_headers/tests/AdditionalMessageHeaders.php</file>
  38 + <file>./../plugins/archive/tests/Archive.php</file>
  39 + <file>./../plugins/autologon/tests/Autologon.php</file>
  40 + <file>./../plugins/database_attachments/tests/DatabaseAttachments.php</file>
  41 + <file>./../plugins/debug_logger/tests/DebugLogger.php</file>
  42 + <file>./../plugins/emoticons/tests/Emoticons.php</file>
  43 + <file>./../plugins/enigma/tests/Enigma.php</file>
  44 + <file>./../plugins/example_addressbook/tests/ExampleAddressbook.php</file>
  45 + <file>./../plugins/filesystem_attachments/tests/FilesystemAttachments.php</file>
  46 + <file>./../plugins/help/tests/Help.php</file>
  47 + <file>./../plugins/hide_blockquote/tests/HideBlockquote.php</file>
  48 + <file>./../plugins/http_authentication/tests/HttpAuthentication.php</file>
  49 + <file>./../plugins/jqueryui/tests/Jqueryui.php</file>
  50 + <file>./../plugins/managesieve/tests/Managesieve.php</file>
36 51 <file>./../plugins/managesieve/tests/Parser.php</file>
37 52 <file>./../plugins/managesieve/tests/Tokenizer.php</file>
  53 + <file>./../plugins/markasjunk/tests/Markasjunk.php</file>
  54 + <file>./../plugins/new_user_dialog/tests/NewUserDialog.php</file>
  55 + <file>./../plugins/new_user_identity/tests/NewUserIdentity.php</file>
  56 + <file>./../plugins/newmail_notifier/tests/NewmailNotifier.php</file>
  57 + <file>./../plugins/password/tests/Password.php</file>
  58 + <file>./../plugins/redundant_attachments/tests/RedundantAttachments.php</file>
  59 + <file>./../plugins/show_additional_headers/tests/ShowAdditionalHeaders.php</file>
  60 + <file>./../plugins/squirrelmail_usercopy/tests/Squirrelmail_usercopy.php</file>
  61 + <file>./../plugins/subscriptions_option/tests/SubscriptionsOption.php</file>
  62 + <file>./../plugins/userinfo/tests/Userinfo.php</file>
  63 + <file>./../plugins/vcard_attachments/tests/VcardAttachments.php</file>
  64 + <file>./../plugins/virtuser_file/tests/VirtuserFile.php</file>
  65 + <file>./../plugins/virtuser_query/tests/VirtuserQuery.php</file>
  66 + <file>./../plugins/zipdownload/tests/Zipdownload.php</file>
38 67 </testsuite>
39 68 </testsuites>
40 69 </phpunit>

0 comments on commit b005927

Please sign in to comment.
Something went wrong with that request. Please try again.