All classes can be tested from now.

1) Add some test files.
2) Create a folder for fronendfile. Move the class file into the folder.
3) Write Bootstrap.php file.
4) Modify phpunit.xml file.
5) Add a context mock class.


git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9850 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-11-22 07:46:47 +00:00
parent aa90148aa3
commit 67751eb85b
8 changed files with 148 additions and 135 deletions

View file

@ -0,0 +1,62 @@
<?php
if(!defined('FOLLOW_REQUEST_SSL')) define('FOLLOW_REQUEST_SSL',0);
if(!defined('ENFORCE_SSL')) define('ENFORCE_SSL',1);
if(!defined('RELEASE_SSL')) define('RELEASE_SSL',2);
class Context
{
public static $mock_vars = array();
public function gets() {
$args = func_get_args();
$output = new stdClass;
foreach($args as $name) {
$output->{$name} = Context::$mock_vars[$name];
}
return $output;
}
public function get($name) {
return array_key_exists($name, Context::$mock_vars)?Context::$mock_vars[$name]:'';
}
public function getRequestVars() {
return Context::$mock_vars;
}
public function set($name, $value) {
Context::$mock_vars[$name] = $value;
}
public function getLangType() {
return 'en';
}
public function getLang($str) {
return $str;
}
public function truncate() {
Context::$mock_vars = array();
}
public function getDBInfo() {
global $use_cdn;
$dbInfo = new stdClass;
$dbInfo->use_cdn = $use_cdn;
return $dbInfo;
}
public function getRequestUrl() {
global $request_url;
return $request_url;
}
}
/* End of file Context.mock.php */
/* Location: ./tests/classes/context/Context.mock.php */