summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-08-27 09:28:16 +0200
committerAleksander Machniak <alec@alec.pl>2012-08-27 09:28:16 +0200
commit5f8adabb6286fdcb0ff8a0ea5d1d58f40eef51f4 (patch)
tree8e6997e584950115850bf698943f1828fb9b9811 /tests
parent9b05f19338e209f05386e5b13fe0a704c94062bb (diff)
Add simple (constructor) tests for Framework classes
Diffstat (limited to 'tests')
-rw-r--r--tests/Framework/BaseReplacer.php20
-rw-r--r--tests/Framework/Browser.php20
-rw-r--r--tests/Framework/Cache.php20
-rw-r--r--tests/Framework/Charset.php28
-rw-r--r--tests/Framework/ContentFilter.php20
-rw-r--r--tests/Framework/Html.php20
-rw-r--r--tests/Framework/Image.php20
-rw-r--r--tests/Framework/Imap.php20
-rw-r--r--tests/Framework/ImapGeneric.php20
-rw-r--r--tests/Framework/MessageHeader.php20
-rw-r--r--tests/Framework/MessagePart.php20
-rw-r--r--tests/Framework/Rcube.php20
-rw-r--r--tests/Framework/ResultIndex.php20
-rw-r--r--tests/Framework/ResultSet.php20
-rw-r--r--tests/Framework/ResultThread.php20
-rw-r--r--tests/Framework/Smtp.php20
-rw-r--r--tests/Framework/Spellchecker.php20
-rw-r--r--tests/Framework/StringReplacer.php20
-rw-r--r--tests/Framework/User.php20
-rw-r--r--tests/phpunit.xml19
20 files changed, 407 insertions, 0 deletions
diff --git a/tests/Framework/BaseReplacer.php b/tests/Framework/BaseReplacer.php
new file mode 100644
index 000000000..e00b9e5eb
--- /dev/null
+++ b/tests/Framework/BaseReplacer.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_base_replacer class
+ *
+ * @package Tests
+ */
+class Framework_BaseReplacer extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_base_replacer('test');
+
+ $this->assertInstanceOf('rcube_base_replacer', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Browser.php b/tests/Framework/Browser.php
new file mode 100644
index 000000000..c3860d8a3
--- /dev/null
+++ b/tests/Framework/Browser.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_browser class
+ *
+ * @package Tests
+ */
+class Framework_Browser extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_browser();
+
+ $this->assertInstanceOf('rcube_browser', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Cache.php b/tests/Framework/Cache.php
new file mode 100644
index 000000000..dc026a634
--- /dev/null
+++ b/tests/Framework/Cache.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_cache class
+ *
+ * @package Tests
+ */
+class Framework_Cache extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_cache('db', 1);
+
+ $this->assertInstanceOf('rcube_cache', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Charset.php b/tests/Framework/Charset.php
new file mode 100644
index 000000000..9e3fad4d3
--- /dev/null
+++ b/tests/Framework/Charset.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * Test class to test rcube_charset class
+ *
+ * @package Tests
+ */
+class Framework_Charset extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Data for test_clean()
+ */
+ function data_clean()
+ {
+ return array(
+ array('', '', 'Empty string'),
+ );
+ }
+
+ /**
+ * @dataProvider data_clean
+ */
+ function test_clean($input, $output, $title)
+ {
+ $this->assertEquals(rcube_charset::clean($input), $output, $title);
+ }
+}
diff --git a/tests/Framework/ContentFilter.php b/tests/Framework/ContentFilter.php
new file mode 100644
index 000000000..9bee9368b
--- /dev/null
+++ b/tests/Framework/ContentFilter.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_content_filter class
+ *
+ * @package Tests
+ */
+class Framework_ContentFilter extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_content_filter();
+
+ $this->assertInstanceOf('rcube_content_filter', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Html.php b/tests/Framework/Html.php
new file mode 100644
index 000000000..107f82805
--- /dev/null
+++ b/tests/Framework/Html.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_html class
+ *
+ * @package Tests
+ */
+class Framework_Html extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new html;
+
+ $this->assertInstanceOf('html', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Image.php b/tests/Framework/Image.php
new file mode 100644
index 000000000..31e852042
--- /dev/null
+++ b/tests/Framework/Image.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_image class
+ *
+ * @package Tests
+ */
+class Framework_Image extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_image('test');
+
+ $this->assertInstanceOf('rcube_image', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Imap.php b/tests/Framework/Imap.php
new file mode 100644
index 000000000..3f52e07be
--- /dev/null
+++ b/tests/Framework/Imap.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_imap class
+ *
+ * @package Tests
+ */
+class Framework_Imap extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_imap;
+
+ $this->assertInstanceOf('rcube_imap', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/ImapGeneric.php b/tests/Framework/ImapGeneric.php
new file mode 100644
index 000000000..0b2cc3d53
--- /dev/null
+++ b/tests/Framework/ImapGeneric.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_imap_generic class
+ *
+ * @package Tests
+ */
+class Framework_ImapGeneric extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_imap_generic;
+
+ $this->assertInstanceOf('rcube_imap_generic', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/MessageHeader.php b/tests/Framework/MessageHeader.php
new file mode 100644
index 000000000..e5bc1752f
--- /dev/null
+++ b/tests/Framework/MessageHeader.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_message_header class
+ *
+ * @package Tests
+ */
+class Framework_MessageHeader extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_message_header;
+
+ $this->assertInstanceOf('rcube_message_header', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/MessagePart.php b/tests/Framework/MessagePart.php
new file mode 100644
index 000000000..deb426024
--- /dev/null
+++ b/tests/Framework/MessagePart.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_message_part class
+ *
+ * @package Tests
+ */
+class Framework_MessagePart extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_message_part;
+
+ $this->assertInstanceOf('rcube_message_part', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Rcube.php b/tests/Framework/Rcube.php
new file mode 100644
index 000000000..637558dc9
--- /dev/null
+++ b/tests/Framework/Rcube.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube class
+ *
+ * @package Tests
+ */
+class Framework_Rcube extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = rcube::get_instance();
+
+ $this->assertInstanceOf('rcube', $object, "Class singleton");
+ }
+}
diff --git a/tests/Framework/ResultIndex.php b/tests/Framework/ResultIndex.php
new file mode 100644
index 000000000..efbba6da7
--- /dev/null
+++ b/tests/Framework/ResultIndex.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_result_index class
+ *
+ * @package Tests
+ */
+class Framework_ResultIndex extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_result_index;
+
+ $this->assertInstanceOf('rcube_result_index', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/ResultSet.php b/tests/Framework/ResultSet.php
new file mode 100644
index 000000000..2d04e53c0
--- /dev/null
+++ b/tests/Framework/ResultSet.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_result_set class
+ *
+ * @package Tests
+ */
+class Framework_ResultSet extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_result_set;
+
+ $this->assertInstanceOf('rcube_result_set', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/ResultThread.php b/tests/Framework/ResultThread.php
new file mode 100644
index 000000000..f980845cc
--- /dev/null
+++ b/tests/Framework/ResultThread.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_result_thread class
+ *
+ * @package Tests
+ */
+class Framework_ResultThread extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_result_thread;
+
+ $this->assertInstanceOf('rcube_result_thread', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Smtp.php b/tests/Framework/Smtp.php
new file mode 100644
index 000000000..4bd78d097
--- /dev/null
+++ b/tests/Framework/Smtp.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_smtp class
+ *
+ * @package Tests
+ */
+class Framework_Smtp extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_smtp;
+
+ $this->assertInstanceOf('rcube_smtp', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/Spellchecker.php b/tests/Framework/Spellchecker.php
new file mode 100644
index 000000000..9c3e92ffd
--- /dev/null
+++ b/tests/Framework/Spellchecker.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_spellchecker class
+ *
+ * @package Tests
+ */
+class Framework_Spellchecker extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $object = new rcube_spellchecker;
+
+ $this->assertInstanceOf('rcube_spellchecker', $object, "Class constructor");
+ }
+}
diff --git a/tests/Framework/StringReplacer.php b/tests/Framework/StringReplacer.php
new file mode 100644
index 000000000..11210c0da
--- /dev/null
+++ b/tests/Framework/StringReplacer.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_string_replacer class
+ *
+ * @package Tests
+ */
+class Framework_StringReplacer extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $sr = new rcube_string_replacer;
+
+ $this->assertInstanceOf('rcube_string_replacer', $sr, "Class constructor");
+ }
+}
diff --git a/tests/Framework/User.php b/tests/Framework/User.php
new file mode 100644
index 000000000..3b1983c58
--- /dev/null
+++ b/tests/Framework/User.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Test class to test rcube_user class
+ *
+ * @package Tests
+ */
+class Framework_User extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Class constructor
+ */
+ function test_class()
+ {
+ $user = new rcube_user;
+
+ $this->assertInstanceOf('rcube_user', $user, "Class constructor");
+ }
+}
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index 1bde91be1..28f7e7420 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -3,8 +3,27 @@
colors="true">
<testsuites>
<testsuite name="All Tests">
+ <file>Framework/BaseReplacer.php</file>
+ <file>Framework/Browser.php</file>
+ <file>Framework/Cache.php</file>
+ <file>Framework/Charset.php</file>
+ <file>Framework/ContentFilter.php</file>
+ <file>Framework/Html.php</file>
+ <file>Framework/Imap.php</file>
+ <file>Framework/ImapGeneric.php</file>
+ <file>Framework/Image.php</file>
+ <file>Framework/MessageHeader.php</file>
+ <file>Framework/MessagePart.php</file>
<file>Framework/Mime.php</file>
+ <file>Framework/Rcube.php</file>
+ <file>Framework/ResultIndex.php</file>
+ <file>Framework/ResultSet.php</file>
+ <file>Framework/ResultThread.php</file>
<file>Framework/Shared.php</file>
+ <file>Framework/Smtp.php</file>
+ <file>Framework/Spellchecker.php</file>
+ <file>Framework/StringReplacer.php</file>
+ <file>Framework/User.php</file>
<file>Framework/Utils.php</file>
<file>Framework/VCard.php</file>
<file>HtmlToText.php</file>