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

@ -1,8 +1,8 @@
<?php
define('__DEBUG__', 1);
$xe_path = realpath(dirname(__FILE__).'/../../../');
require "{$xe_path}/classes/security/Security.class.php";
if(!defined('__XE__')) require dirname(__FILE__).'/../../Bootstrap.php';
require_once _XE_PATH_.'/classes/security/Security.class.php';
error_reporting(E_ALL & ~E_NOTICE);
@ -119,32 +119,10 @@ class SecurityTest extends PHPUnit_Framework_TestCase
}
}
$mock_vars = array();
class Context
if(!class_exists('Context'))
{
public function gets() {
global $mock_vars;
$args = func_get_args();
$output = new stdClass;
foreach($args as $name) {
$output->{$name} = $mock_vars[$name];
}
return $output;
}
public function get($name) {
global $mock_vars;
return array_key_exists($name, $mock_vars)?$mock_vars[$name]:'';
}
public function set($name, $value) {
global $mock_vars;
$mock_vars[$name] = $value;
}
require _XE_PATH_.'/tests/classes/context/Context.mock.php';
}
/* End of file SecurityTest.php */
/* Location: ./tests/classes/security/SecurityTest.php */