summaryrefslogtreecommitdiffstats
path: root/tests/mocks/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mocks/libraries')
-rw-r--r--tests/mocks/libraries/calendar.php25
-rw-r--r--tests/mocks/libraries/driver.php27
-rw-r--r--tests/mocks/libraries/session.php7
3 files changed, 27 insertions, 32 deletions
diff --git a/tests/mocks/libraries/calendar.php b/tests/mocks/libraries/calendar.php
deleted file mode 100644
index 8fee5365e..000000000
--- a/tests/mocks/libraries/calendar.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-class Mock_Libraries_Calendar extends CI_Calendar {
-
- public function __construct($config = array())
- {
- $this->CI = new stdClass;
- $this->CI->lang = new Mock_Core_Lang();
-
- if ( ! in_array('calendar_lang.php', $this->CI->lang->is_loaded, TRUE))
- {
- $this->CI->lang->load('calendar');
- }
-
- $this->local_time = time();
-
- if (count($config) > 0)
- {
- $this->initialize($config);
- }
-
- log_message('debug', 'Calendar Class Initialized');
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/libraries/driver.php b/tests/mocks/libraries/driver.php
new file mode 100644
index 000000000..91bb01596
--- /dev/null
+++ b/tests/mocks/libraries/driver.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Mock library to subclass Driver for testing
+ */
+class Mock_Libraries_Driver extends CI_Driver_Library {
+ /**
+ * Set valid drivers list
+ */
+ public function driver_list($drivers = NULL)
+ {
+ if (empty($drivers))
+ {
+ return $this->valid_drivers;
+ }
+
+ $this->valid_drivers = (array) $drivers;
+ }
+
+ /**
+ * Get library name
+ */
+ public function get_name()
+ {
+ return $this->lib_name;
+ }
+}
diff --git a/tests/mocks/libraries/session.php b/tests/mocks/libraries/session.php
index c6e194f58..11b27cf67 100644
--- a/tests/mocks/libraries/session.php
+++ b/tests/mocks/libraries/session.php
@@ -4,7 +4,6 @@
* Mock library to add testing features to Session driver library
*/
class Mock_Libraries_Session extends CI_Session {
-
/**
* Simulate new page load
*/
@@ -20,7 +19,6 @@ class Mock_Libraries_Session extends CI_Session {
* Mock cookie driver to overload cookie setting
*/
class Mock_Libraries_Session_cookie extends CI_Session_cookie {
-
/**
* Overload _setcookie to manage $_COOKIE values, since actual cookies can't be set in unit testing
*/
@@ -36,8 +34,3 @@ class Mock_Libraries_Session_cookie extends CI_Session_cookie {
}
}
}
-
-/**
- * Mock native driver (just for consistency in loading)
- */
-class Mock_Libraries_Session_native extends CI_Session_native { } \ No newline at end of file