ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilUnitUtil.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10{
14 public static function performInitialisation()
15 {
19 global $ilErr;
20
21 define('IL_PHPUNIT_TEST', true);
22
23 session_id('phpunittest');
24 $_SESSION = array();
25
26 include 'Services/PHPUnit/config/cfg.phpunit.php';
27
28 include_once 'Services/Context/classes/class.ilContext.php';
30
31 include_once('Services/Init/classes/class.ilInitialisation.php');
33 ilInitialisation::initUserAccount();
34
35 $ilUnitUtil = new self();
36 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilUnitUtil, 'errorHandler'));
37 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilUnitUtil, 'errorHandler'));
38 }
39
44 public function errorHandler($a_error_obj)
45 {
46 echo "Error occured: ".get_class($a_error_obj)."\n";
47 try
48 {
49 throw new Exception("dummy");
50 }
51 catch(Exception $e)
52 {
53 echo($e->getTraceAsString()."\n\n");
54 }
55 exit();
56 }
57}
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
setErrorHandling($mode=null, $options=null)
Sets how errors generated by this object should be handled.
Definition: PEAR.php:335
const CONTEXT_UNITTEST
static init($a_type)
Init context by type.
static initILIAS()
ilias initialisation
Utilities for Unit Testing.
errorHandler($a_error_obj)
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
exit
Definition: login.php:54