blob: a21fc5cb342aa77dce0ab5ae61f98bd135b5a099 [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
Claudio Galdiolocb290492015-01-29 10:21:55 -050013 // Override inaccessible protected properties
Taufan Aditya8af88f32012-05-15 21:52:53 +070014 public function __get($property)
15 {
16 return isset($this->{'_'.$property}) ? $this->{'_'.$property} : NULL;
17 }
18
Claudio Galdiolocb290492015-01-29 10:21:55 -050019 // Override inaccessible protected method
Taufan Aditya8af88f32012-05-15 21:52:53 +070020 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
Claudio Galdiolocb290492015-01-29 10:21:55 -050030}