summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php66
-rw-r--r--system/database/drivers/sqlite/sqlite_forge.php106
-rw-r--r--tests/mocks/autoloader.php79
-rw-r--r--tests/mocks/ci_testcase.php196
-rw-r--r--tests/mocks/core/common.php132
-rw-r--r--tests/mocks/core/loader.php30
-rw-r--r--tests/mocks/core/uri.php25
-rw-r--r--tests/mocks/libraries/parser.php3
-rw-r--r--tests/mocks/libraries/table.php15
-rw-r--r--tests/mocks/libraries/typography.php3
-rw-r--r--tests/mocks/libraries/useragent.php3
11 files changed, 47 insertions, 611 deletions
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index 3a986d0a8..7936b6114 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -43,7 +43,7 @@ class CI_DB_sqlite_driver extends CI_DB {
public $dbdriver = 'sqlite';
// The character used to escape with - not needed for SQLite
- protected $_escape_char = '';
+ protected $_escape_char = '"';
// clause and character used for LIKE escape sequences
protected $_like_escape_str = " ESCAPE '%s' ";
@@ -127,7 +127,9 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
protected function _execute($sql)
{
- return @sqlite_query($this->conn_id, $sql);
+ return $this->is_write_type($sql)
+ ? @sqlite_exec($this->conn_id, $sql)
+ : @sqlite_query($this->conn_id, $sql);
}
// --------------------------------------------------------------------
@@ -139,13 +141,8 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
public function trans_begin($test_mode = FALSE)
{
- if ( ! $this->trans_enabled)
- {
- return TRUE;
- }
-
// When transactions are nested we only begin/commit/rollback the outermost ones
- if ($this->_trans_depth > 0)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -153,7 +150,7 @@ class CI_DB_sqlite_driver extends CI_DB {
// Reset the transaction failure flag.
// If the $test_mode flag is set to TRUE transactions will be rolled back
// even if the queries produce a successful result.
- $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE;
+ $this->_trans_failure = ($test_mode === TRUE);
$this->simple_query('BEGIN TRANSACTION');
return TRUE;
@@ -168,13 +165,8 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
public function trans_commit()
{
- if ( ! $this->trans_enabled)
- {
- return TRUE;
- }
-
// When transactions are nested we only begin/commit/rollback the outermost ones
- if ($this->_trans_depth > 0)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -192,13 +184,8 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
public function trans_rollback()
{
- if ( ! $this->trans_enabled)
- {
- return TRUE;
- }
-
// When transactions are nested we only begin/commit/rollback the outermost ones
- if ($this->_trans_depth > 0)
+ if ( ! $this->trans_enabled OR $this->_trans_depth > 0)
{
return TRUE;
}
@@ -274,7 +261,7 @@ class CI_DB_sqlite_driver extends CI_DB {
* the specified database
*
* @param string
- * @return string
+ * @return int
*/
public function count_all($table = '')
{
@@ -289,9 +276,9 @@ class CI_DB_sqlite_driver extends CI_DB {
return 0;
}
- $row = $query->row();
- $this->_reset_select();
- return (int) $row->numrows;
+ $query = $query->row();
+ $this->_data_seek(0);
+ return (int) $query->numrows;
}
// --------------------------------------------------------------------
@@ -306,12 +293,13 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
protected function _list_tables($prefix_limit = FALSE)
{
- $sql = "SELECT name from sqlite_master WHERE type='table'";
+ $sql = "SELECT name FROM sqlite_master WHERE type='table'";
- if ($prefix_limit !== FALSE AND $this->dbprefix != '')
+ if ($prefix_limit !== FALSE && $this->dbprefix != '')
{
- $sql .= " AND 'name' LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
+ return $sql." AND 'name' LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
}
+
return $sql;
}
@@ -343,7 +331,7 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
protected function _field_data($table)
{
- return "SELECT * FROM ".$table." LIMIT 1";
+ return 'SELECT * FROM '.$table.' LIMIT 1';
}
// --------------------------------------------------------------------
@@ -437,19 +425,16 @@ class CI_DB_sqlite_driver extends CI_DB {
if (count($where) > 0 OR count($like) > 0)
{
- $conditions = "\nWHERE ";
- $conditions .= implode("\n", $this->ar_where);
+ $conditions = "\nWHERE ".implode("\n", $this->ar_where);
if (count($where) > 0 && count($like) > 0)
{
- $conditions .= " AND ";
+ $conditions .= ' AND ';
}
$conditions .= implode("\n", $like);
}
- $limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
-
- return "DELETE FROM ".$table.$conditions.$limit;
+ return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit);
}
// --------------------------------------------------------------------
@@ -466,16 +451,7 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
protected function _limit($sql, $limit, $offset)
{
- if ($offset == 0)
- {
- $offset = '';
- }
- else
- {
- $offset .= ", ";
- }
-
- return $sql."LIMIT ".$offset.$limit;
+ return $sql.'LIMIT '.($offset == 0 ? '' : $offset.', ').$limit;
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index a62e8d9ae..70bb6a70b 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -59,12 +59,9 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
{
if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database))
{
- if ($this->db->db_debug)
- {
- return $this->db->display_error('db_unable_to_drop');
- }
- return FALSE;
+ return ($this->db->db_debug) ? $this->db->display_error('db_unable_to_drop') : FALSE;
}
+
return TRUE;
}
@@ -100,44 +97,19 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
// entered the field information, so we'll simply add it to the list
if (is_numeric($field))
{
- $sql .= "\n\t$attributes";
+ $sql .= "\n\t".$attributes;
}
else
{
$attributes = array_change_key_case($attributes, CASE_UPPER);
- $sql .= "\n\t".$this->db->protect_identifiers($field);
-
- $sql .= ' '.$attributes['TYPE'];
-
- if (array_key_exists('CONSTRAINT', $attributes))
- {
- $sql .= '('.$attributes['CONSTRAINT'].')';
- }
-
- if (array_key_exists('UNSIGNED', $attributes) && $attributes['UNSIGNED'] === TRUE)
- {
- $sql .= ' UNSIGNED';
- }
-
- if (array_key_exists('DEFAULT', $attributes))
- {
- $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\'';
- }
-
- if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE)
- {
- $sql .= ' NULL';
- }
- else
- {
- $sql .= ' NOT NULL';
- }
-
- if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE)
- {
- $sql .= ' AUTO_INCREMENT';
- }
+ $sql .= "\n\t".$this->db->protect_identifiers($field)
+ .' '.$attributes['TYPE']
+ .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
+ .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .(isset($attributes['DEFAULT']) ? ' DEFAULT \''.$attributes['DEFAULT'].'\'' : '')
+ .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
+ .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
}
// don't add a comma on the end of the last field
@@ -149,8 +121,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $primary_keys = $this->db->protect_identifiers($primary_keys);
- $sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")";
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -166,13 +137,11 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
$key = array($this->db->protect_identifiers($key));
}
- $sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")";
+ $sql .= ",\n\tUNIQUE (".implode(', ', $key).')';
}
}
- $sql .= "\n)";
-
- return $sql;
+ return $sql."\n)";
}
// --------------------------------------------------------------------
@@ -180,15 +149,11 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
/**
* Drop Table
*
- * @return bool
+ * @return string
*/
public function _drop_table($table)
{
- if ($this->db->db_debug)
- {
- return $this->db->display_error('db_unsuported_feature');
- }
- return array();
+ return 'DROP TABLE '.$table.' IF EXISTS';
}
// --------------------------------------------------------------------
@@ -210,40 +175,21 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
*/
public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
{
- $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name);
-
- // DROP has everything it needs now.
- if ($alter_type == 'DROP')
+ /* SQLite only supports adding new columns and it does
+ * NOT support the AFTER statement. Each new column will
+ * be added as the last one in the table.
+ */
+ if ($alter_type !== 'ADD COLUMN')
{
- // SQLite does not support dropping columns
- // http://www.sqlite.org/omitted.html
- // http://www.sqlite.org/faq.html#q11
+ // Not supported
return FALSE;
}
- $sql .= " $column_definition";
-
- if ($default_value != '')
- {
- $sql .= " DEFAULT \"$default_value\"";
- }
-
- if ($null === NULL)
- {
- $sql .= ' NULL';
- }
- else
- {
- $sql .= ' NOT NULL';
- }
-
- if ($after_field != '')
- {
- return $sql.' AFTER '.$this->db->protect_identifiers($after_field);
- }
-
- return $sql;
-
+ return 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name)
+ .' '.$column_definition
+ .($default_value != '' ? ' DEFAULT "'.$default_value.'"' : '')
+ // If NOT NULL is specified, the field must have a DEFAULT value other than NULL
+ .(($null !== NULL && $default_value !== 'NULL') ? ' NOT NULL' : ' NULL');
}
// --------------------------------------------------------------------
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
deleted file mode 100644
index dd5929206..000000000
--- a/tests/mocks/autoloader.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-
-// This autoloader provide convinient way to working with mock object
-// make the test looks natural. This autoloader support cascade file loading as well
-// within mocks directory.
-//
-// Prototype :
-//
-// include_once('Mock_Core_Loader') // Will load ./mocks/core/loader.php
-// $mock_table = new Mock_Libraries_Table(); // Will load ./mocks/libraries/table.php
-// $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php
-// and so on...
-function autoload($class)
-{
- $dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
-
- $ci_core = array(
- 'Benchmark', 'Config', 'Controller',
- 'Exceptions', 'Hooks', 'Input',
- 'Lang', 'Loader', 'Model',
- 'Output', 'Router', 'Security',
- 'URI', 'Utf8',
- );
-
- $ci_libraries = array(
- 'Calendar', 'Cart', 'Driver',
- 'Email', 'Encrypt', 'Form_validation',
- 'Ftp', 'Image_lib', 'Javascript',
- 'Log', 'Migration', 'Pagination',
- 'Parser', 'Profiler', 'Session',
- 'Table', 'Trackback', 'Typography',
- 'Unit_test', 'Upload', 'User_agent',
- 'Xmlrpc', 'Zip',
- );
-
- if (strpos($class, 'Mock_') === 0)
- {
- $class = str_replace(array('Mock_', '_'), array('', DIRECTORY_SEPARATOR), $class);
- $class = strtolower($class);
- }
- elseif (strpos($class, 'CI_') === 0)
- {
- $fragments = explode('_', $class, 2);
- $subclass = next($fragments);
-
- if (in_array($subclass, $ci_core))
- {
- $dir = BASEPATH.'core'.DIRECTORY_SEPARATOR;
- $class = $subclass;
- }
- elseif (in_array($subclass, $ci_libraries))
- {
- $dir = BASEPATH.'libraries'.DIRECTORY_SEPARATOR;
- $class = $subclass;
- }
- else
- {
- $class = strtolower($class);
- }
- }
-
- $file = $dir.$class.'.php';
-
- if ( ! file_exists($file))
- {
- $trace = debug_backtrace();
-
- // If the autoload call came from `class_exists` or `file_exists`,
- // we skipped and return FALSE
- if ($trace[2]['function'] == 'class_exists' OR $trace[2]['function'] == 'file_exists')
- {
- return FALSE;
- }
-
- throw new InvalidArgumentException("Unable to load $class.");
- }
-
- include_once($file);
-} \ No newline at end of file
diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php
deleted file mode 100644
index f327e6b07..000000000
--- a/tests/mocks/ci_testcase.php
+++ /dev/null
@@ -1,196 +0,0 @@
-<?php
-
-class CI_TestCase extends PHPUnit_Framework_TestCase {
-
- protected $ci_config;
- protected $ci_instance;
- protected static $ci_test_instance;
-
- private $global_map = array(
- 'benchmark' => 'bm',
- 'config' => 'cfg',
- 'hooks' => 'ext',
- 'utf8' => 'uni',
- 'router' => 'rtr',
- 'output' => 'out',
- 'security' => 'sec',
- 'input' => 'in',
- 'lang' => 'lang',
- 'loader' => 'load',
- 'model' => 'model'
- );
-
- // --------------------------------------------------------------------
-
- public function __construct()
- {
- parent::__construct();
-
- $this->ci_config = array();
- }
-
- // --------------------------------------------------------------------
-
- public function setUp()
- {
- if (method_exists($this, 'set_up'))
- {
- $this->set_up();
- }
- }
-
- // --------------------------------------------------------------------
-
- public function tearDown()
- {
- if (method_exists($this, 'tear_down'))
- {
- $this->tear_down();
- }
- }
-
- // --------------------------------------------------------------------
-
- public static function instance()
- {
- return self::$ci_test_instance;
- }
-
- // --------------------------------------------------------------------
-
- function ci_set_config($key, $val = '')
- {
- if (is_array($key))
- {
- $this->ci_config = $key;
- }
- else
- {
- $this->ci_config[$key] = $val;
- }
- }
-
- // --------------------------------------------------------------------
-
- function ci_get_config()
- {
- return $this->ci_config;
- }
-
- // --------------------------------------------------------------------
-
- function ci_instance($obj = FALSE)
- {
- if ( ! is_object($obj))
- {
- return $this->ci_instance;
- }
-
- $this->ci_instance = $obj;
- }
-
- // --------------------------------------------------------------------
-
- function ci_instance_var($name, $obj = FALSE)
- {
- if ( ! is_object($obj))
- {
- return $this->ci_instance->$name;
- }
-
- $this->ci_instance->$name =& $obj;
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Grab a core class
- *
- * Loads the correct core class without extensions
- * and returns a reference to the class name in the
- * globals array with the correct key. This way the
- * test can modify the variable it assigns to and
- * still maintain the global.
- */
- function &ci_core_class($name)
- {
- $name = strtolower($name);
-
- if (isset($this->global_map[$name]))
- {
- $class_name = ucfirst($name);
- $global_name = $this->global_map[$name];
- }
- elseif (in_array($name, $this->global_map))
- {
- $class_name = ucfirst(array_search($name, $this->global_map));
- $global_name = $name;
- }
- else
- {
- throw new Exception('Not a valid core class.');
- }
-
- if ( ! class_exists('CI_'.$class_name))
- {
- require_once BASEPATH.'core/'.$class_name.'.php';
- }
-
- $GLOBALS[strtoupper($global_name)] = 'CI_'.$class_name;
- return $GLOBALS[strtoupper($global_name)];
- }
-
- // --------------------------------------------------------------------
-
- // convenience function for global mocks
- function ci_set_core_class($name, $obj)
- {
- $orig =& $this->ci_core_class($name);
- $orig = $obj;
- }
-
- // --------------------------------------------------------------------
- // Internals
- // --------------------------------------------------------------------
-
- /**
- * Overwrite runBare
- *
- * PHPUnit instantiates the test classes before
- * running them individually. So right before a test
- * runs we set our instance. Normally this step would
- * happen in setUp, but someone is bound to forget to
- * call the parent method and debugging this is no fun.
- */
- public function runBare()
- {
- self::$ci_test_instance = $this;
- parent::runBare();
- }
-
- // --------------------------------------------------------------------
-
- function helper($name)
- {
- require_once(BASEPATH.'helpers/'.$name.'_helper.php');
- }
-
- // --------------------------------------------------------------------
-
- /**
- * This overload is useful to create a stub, that need to have a specific method.
- */
- function __call($method, $args)
- {
- if ($this->{$method} instanceof Closure)
- {
- return call_user_func_array($this->{$method},$args);
- }
- else
- {
- return parent::__call($method, $args);
- }
- }
-}
-
-// EOF \ No newline at end of file
diff --git a/tests/mocks/core/common.php b/tests/mocks/core/common.php
deleted file mode 100644
index fc94d7fff..000000000
--- a/tests/mocks/core/common.php
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-
-// Set up the global CI functions in their most minimal core representation
-
-function &get_instance()
-{
- $test = CI_TestCase::instance();
- $instance = $test->ci_instance();
- return $instance;
-}
-
-// --------------------------------------------------------------------
-
-function &get_config() {
- $test = CI_TestCase::instance();
- $config = $test->ci_get_config();
-
- return $config;
-}
-
-function config_item($item)
-{
- $config =& get_config();
-
- if ( ! isset($config[$item]))
- {
- return FALSE;
- }
-
- return $config[$item];
-}
-
-// --------------------------------------------------------------------
-
-function load_class($class, $directory = 'libraries', $prefix = 'CI_')
-{
- if ($directory != 'core' OR $prefix != 'CI_')
- {
- throw new Exception('Not Implemented: Non-core load_class()');
- }
-
- $test = CI_TestCase::instance();
-
- $obj =& $test->ci_core_class($class);
-
- if (is_string($obj))
- {
- throw new Exception('Bad Isolation: Use ci_set_core_class to set '.$class.'');
- }
-
- return $obj;
-}
-
-// This is sort of meh. Should probably be mocked up with
-// controllable output, so that we can test some of our
-// security code. The function itself will be tested in the
-// bootstrap testsuite.
-// --------------------------------------------------------------------
-
-function remove_invisible_characters($str, $url_encoded = TRUE)
-{
- $non_displayables = array();
-
- // every control character except newline (dec 10)
- // carriage return (dec 13), and horizontal tab (dec 09)
-
- if ($url_encoded)
- {
- $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15
- $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31
- }
-
- $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127
-
- do
- {
- $str = preg_replace($non_displayables, '', $str, -1, $count);
- }
- while ($count);
-
- return $str;
-}
-
-
-// Clean up error messages
-// --------------------------------------------------------------------
-
-function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered')
-{
- throw new RuntimeException('CI Error: '.$message);
-}
-
-function show_404($page = '', $log_error = TRUE)
-{
- throw new RuntimeException('CI Error: 404');
-}
-
-function _exception_handler($severity, $message, $filepath, $line)
-{
- throw new RuntimeException('CI Exception: '.$message.' | '.$filepath.' | '.$line);
-}
-
-
-// We assume a few things about our environment ...
-// --------------------------------------------------------------------
-
-function is_php($version = '5.0.0')
-{
- return ! (version_compare(PHP_VERSION, $version) < 0);
-}
-
-function is_really_writable($file)
-{
- return is_writable($file);
-}
-
-function is_loaded()
-{
- throw new Exception('Bad Isolation: mock up environment');
-}
-
-function log_message($level = 'error', $message, $php_error = FALSE)
-{
- return TRUE;
-}
-
-function set_status_header($code = 200, $text = '')
-{
- return TRUE;
-}
-
-// EOF \ No newline at end of file
diff --git a/tests/mocks/core/loader.php b/tests/mocks/core/loader.php
deleted file mode 100644
index d4b29bb3d..000000000
--- a/tests/mocks/core/loader.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-class Mock_Core_Loader extends CI_Loader {
-
- /**
- * Since we use paths to load up models, views, etc, we need the ability to
- * mock up the file system so when core tests are run, we aren't mucking
- * in the application directory. this will give finer grained control over
- * these tests. So yeah, while this looks odd, I need to overwrite protected
- * class vars in the loader. So here we go...
- *
- * @covers CI_Loader::__construct()
- */
- public function __construct()
- {
- vfsStreamWrapper::register();
- vfsStreamWrapper::setRoot(new vfsStreamDirectory('application'));
-
- $this->models_dir = vfsStream::newDirectory('models')->at(vfsStreamWrapper::getRoot());
- $this->libs_dir = vfsStream::newDirectory('libraries')->at(vfsStreamWrapper::getRoot());
- $this->helpers_dir = vfsStream::newDirectory('helpers')->at(vfsStreamWrapper::getRoot());
- $this->views_dir = vfsStream::newDirectory('views')->at(vfsStreamWrapper::getRoot());
-
- $this->_ci_ob_level = ob_get_level();
- $this->_ci_library_paths = array(vfsStream::url('application').'/', BASEPATH);
- $this->_ci_helper_paths = array(vfsStream::url('application').'/', BASEPATH);
- $this->_ci_model_paths = array(vfsStream::url('application').'/');
- $this->_ci_view_paths = array(vfsStream::url('application').'/views/' => TRUE);
- }
-} \ No newline at end of file
diff --git a/tests/mocks/core/uri.php b/tests/mocks/core/uri.php
deleted file mode 100644
index b6946091e..000000000
--- a/tests/mocks/core/uri.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-class Mock_Core_URI extends CI_URI {
-
- public function __construct()
- {
- $test = CI_TestCase::instance();
- $cls =& $test->ci_core_class('cfg');
-
- // set predictable config values
- $test->ci_set_config(array(
- 'index_page' => 'index.php',
- 'base_url' => 'http://example.com/',
- 'subclass_prefix' => 'MY_'
- ));
-
- $this->config = new $cls;
-
- }
-
- protected function _is_cli_request()
- {
- return FALSE;
- }
-} \ No newline at end of file
diff --git a/tests/mocks/libraries/parser.php b/tests/mocks/libraries/parser.php
deleted file mode 100644
index 81dcfb37e..000000000
--- a/tests/mocks/libraries/parser.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-class Mock_Libraries_Parser extends CI_Parser {} \ No newline at end of file
diff --git a/tests/mocks/libraries/table.php b/tests/mocks/libraries/table.php
deleted file mode 100644
index 1a6ff8d35..000000000
--- a/tests/mocks/libraries/table.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-class Mock_Libraries_Table extends CI_Table {
-
- // Overide inaccesible private or protected method
- public function __call($method, $params)
- {
- if (is_callable(array($this, '_'.$method)))
- {
- return call_user_func_array(array($this, '_'.$method), $params);
- }
-
- throw new BadMethodCallException('Method '.$method.' was not found');
- }
-} \ No newline at end of file
diff --git a/tests/mocks/libraries/typography.php b/tests/mocks/libraries/typography.php
deleted file mode 100644
index 0f76c5745..000000000
--- a/tests/mocks/libraries/typography.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-class Mock_Libraries_Typography extends CI_Typography {} \ No newline at end of file
diff --git a/tests/mocks/libraries/useragent.php b/tests/mocks/libraries/useragent.php
deleted file mode 100644
index c957cde5b..000000000
--- a/tests/mocks/libraries/useragent.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-class Mock_Libraries_UserAgent extends CI_User_agent {} \ No newline at end of file