summaryrefslogtreecommitdiff
path: root/ext/imap/tests/imap_constructor.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/imap/tests/imap_constructor.phpt')
-rw-r--r--ext/imap/tests/imap_constructor.phpt15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/imap/tests/imap_constructor.phpt b/ext/imap/tests/imap_constructor.phpt
new file mode 100644
index 0000000000..bc5da991d1
--- /dev/null
+++ b/ext/imap/tests/imap_constructor.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Attempt to instantiate an IMAPConnection directly
+--SKIPIF--
+<?php
+extension_loaded('imap') or die('skip imap extension not available in this build');
+--FILE--
+<?php
+
+try {
+ new IMAPConnection();
+} catch (Error $ex) {
+ echo "Exception: ", $ex->getMessage(), "\n";
+}
+--EXPECT--
+Exception: Cannot directly construct IMAPConnection, use imap_open() instead