Closed AlessandroMinoccheri closed 10 years ago
I have already solved in this way:
$CI =& get_instance();
$CI->load->model('backend/Booking_Model');
$CI->load->model('backend/User_Model');
require_once(BASEPATH.'libraries/Session.php');
$this->_ci->session = $this->getMock('CI_Session');
$this->_ci->session->set_userdata('username', 'administrator');
$this->_ci->session->set_userdata('user_id', '1');
$this->_ci->session->set_userdata('agency_id', '1');
$data = array(
"0" => array(
"provider_id" => 3,
"provider_code" => 'DB_0000000135_2014/0',
"provider_reference" => $CI->Hotel_Model->getLastBookingHotelDatabase(),
"booking_status_id" => 2,
"room_code" => '2'
)
);
Hi all, I'm trying to test a model which use sessions.
This is my test code:
Return me some error like this:
How can I use session?
Thanks