blob: e19a8b20b6fb7cb4cd8267ee0fd7ff26f951d179 [file] [log] [blame]
Taufan Aditya8af88f32012-05-15 21:52:53 +07001<?php
2
3class Mock_Core_Security extends CI_Security {
Andrey Andreevf243ce12012-06-09 23:34:21 +03004
Taufan Aditya8af88f32012-05-15 21:52:53 +07005 public function csrf_set_cookie()
6 {
Taufan Adityad40a5452012-05-15 22:00:14 +07007 // We cannot set cookie in CLI mode, so for csrf test, who rely on $_COOKIE,
8 // we superseded set_cookie with directly set the cookie variable,
Taufan Aditya7756af52012-05-15 23:57:05 +07009 // @see : ./tests/codeigniter/core/Security_test.php, line 8
Taufan Aditya8af88f32012-05-15 21:52:53 +070010 return $this;
11 }
12
13 // Overide inaccesible protected properties
14 public function __get($property)
15 {
16 return isset($this->{'_'.$property}) ? $this->{'_'.$property} : NULL;
17 }
18
19 // Overide inaccesible protected method
20 public function __call($method, $params)
21 {
22 if (is_callable(array($this, '_'.$method)))
23 {
24 return call_user_func_array(array($this, '_'.$method), $params);
25 }
26
27 throw new BadMethodCallException('Method '.$method.' was not found');
28 }
29
30}