summaryrefslogtreecommitdiffstats
path: root/tests/mocks
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-03-28 11:24:23 +0200
committerTaufan Aditya <toopay@taufanaditya.com>2012-03-28 11:24:23 +0200
commitd44d720ba8b17fa58cb041111dca9c440f823446 (patch)
treefd5fe1a688748c3b0a21c31ecfaecf1072c19a4e /tests/mocks
parentd61b772e8c074644262218dff0b1f91a2f3b3a14 (diff)
Implementation of Mock class, remove ugly reflection class
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/libraries/table.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/mocks/libraries/table.php b/tests/mocks/libraries/table.php
index a1e998bb4..1a6ff8d35 100644
--- a/tests/mocks/libraries/table.php
+++ b/tests/mocks/libraries/table.php
@@ -1,3 +1,15 @@
<?php
-class Mock_Libraries_Table extends CI_Table {} \ No newline at end of file
+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