tims-todo/tests/bootstrap.php

53 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2014-08-08 15:41:59 -04:00
<?php
// Autoloader for password compat
require_once(__DIR__ . '/../vendor/autoload.php');
2014-08-08 15:41:59 -04:00
// Require base bootstrap file
require_once(__DIR__ . '/../application/third_party/CIUnit/bootstrap_phpunit.php');
2014-08-08 15:41:59 -04:00
// Require autoloader
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);
}
}