2014-08-08 15:41:59 -04:00
|
|
|
<?php
|
|
|
|
|
2014-08-13 15:57:24 -04:00
|
|
|
// Autoloader for password compat
|
|
|
|
require_once(__DIR__ . '/../vendor/autoload.php');
|
|
|
|
|
2014-08-08 15:41:59 -04:00
|
|
|
// Require base bootstrap file
|
2014-08-12 16:40:21 -04:00
|
|
|
require_once(__DIR__ . '/../application/third_party/CIUnit/bootstrap_phpunit.php');
|
2014-08-08 15:41:59 -04:00
|
|
|
|
|
|
|
// Require autoloader
|
2014-08-12 16:40:21 -04:00
|
|
|
require_once(__DIR__ . '/env/autoloader.php');
|
2014-08-08 15:41:59 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Noop Controller
|
|
|
|
*/
|
|
|
|
class Welcome extends CIU_Controller {}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base TestSuite
|
2014-08-13 20:50:57 -04:00
|
|
|
*
|
|
|
|
* @method bool assertEquals(mixed $expected, mixed $actual)
|
|
|
|
* @method bool assertNotEquals(mixed $expected, mixed $actual)
|
2014-08-08 15:41:59 -04:00
|
|
|
*/
|
|
|
|
class Todo_TestCase extends CIUnit_TestCase {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup for each test method
|
|
|
|
*/
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->CI = set_controller('welcome');
|
|
|
|
parent::setUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Populates a session with mock data
|
|
|
|
*
|
|
|
|
* @param array $more_data
|
|
|
|
*/
|
|
|
|
public function create_session($more_data = [])
|
|
|
|
{
|
|
|
|
$data = [
|
|
|
|
'ip_address' => '8.8.8.8',
|
|
|
|
'user_agent' => 'PHPUnit',
|
|
|
|
'last_activity' => '1234567890',
|
|
|
|
'session_id' => 'jh38uckkjhcijedk'
|
|
|
|
];
|
|
|
|
|
|
|
|
$data = array_merge($data, $more_data);
|
|
|
|
|
|
|
|
$this->CI->session->set_userdata($data);
|
|
|
|
}
|
|
|
|
}
|