mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-27 13:22:06 +02:00
Some test adjustments to make things a little smoother, and prepare for some widget tests
This commit is contained in:
parent
da5cf61542
commit
319d217a3e
@ -1257,6 +1257,9 @@ class Accounts
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
|
if (self::$_instance === $this)
|
||||||
|
{
|
||||||
self::$_instance = NULL;
|
self::$_instance = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -143,6 +143,7 @@ class Widget
|
|||||||
{
|
{
|
||||||
throw new Api\Exception\WrongParameter("Can't parse xml:\n$xml");
|
throw new Api\Exception\WrongParameter("Can't parse xml:\n$xml");
|
||||||
}
|
}
|
||||||
|
$reader->read();
|
||||||
}
|
}
|
||||||
return $reader;
|
return $reader;
|
||||||
}
|
}
|
||||||
@ -309,6 +310,10 @@ class Widget
|
|||||||
{
|
{
|
||||||
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__.'/Widget')) as $path)
|
foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__.'/Widget')) as $path)
|
||||||
{
|
{
|
||||||
|
if(strpos($path, 'test/') !== FALSE)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(substr($path, -4) == '.php')
|
if(substr($path, -4) == '.php')
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -411,7 +416,7 @@ class Widget
|
|||||||
if(!$xml)
|
if(!$xml)
|
||||||
{
|
{
|
||||||
if (empty($type)) $type = 'widget';
|
if (empty($type)) $type = 'widget';
|
||||||
$xml = "<$type id='$id'/>";
|
$xml = "<$type id=\"$id\"/>";
|
||||||
}
|
}
|
||||||
//error_log(__METHOD__."('$type', ..., '$id') using $class_name");
|
//error_log(__METHOD__."('$type', ..., '$id') using $class_name");
|
||||||
|
|
||||||
|
@ -85,9 +85,13 @@ abstract class LoggedInTest extends TestCase
|
|||||||
$GLOBALS['egw']->session->kp3
|
$GLOBALS['egw']->session->kp3
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if($GLOBALS['egw']->acl)
|
||||||
|
{
|
||||||
|
$GLOBALS['egw']->acl = null;
|
||||||
|
}
|
||||||
if($GLOBALS['egw']->accounts)
|
if($GLOBALS['egw']->accounts)
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->accounts->backend = null;
|
$GLOBALS['egw']->accounts = null;
|
||||||
}
|
}
|
||||||
if($GLOBALS['egw']->applications)
|
if($GLOBALS['egw']->applications)
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<phpunit
|
<phpunit
|
||||||
colors="true"
|
colors="true"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
|
bootstrap="phpunit_bootstrap.php"
|
||||||
>
|
>
|
||||||
<php>
|
<php>
|
||||||
<var name="EGW_DOMAIN" value="default" />
|
<var name="EGW_DOMAIN" value="default" />
|
||||||
|
20
doc/phpunit_bootstrap.php
Normal file
20
doc/phpunit_bootstrap.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run before PHPUnit starts - common stuff for _all_ tests, like getting
|
||||||
|
* the autoloader.
|
||||||
|
* This file is automatically run once before starting.
|
||||||
|
*
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @author Nathan Gray
|
||||||
|
* @package
|
||||||
|
* @copyright (c) 2017 Nathan Gray
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
// autoloader & check_load_extension
|
||||||
|
require_once realpath(__DIR__.'/../api/src/loader/common.php');
|
||||||
|
|
||||||
|
// Needed to let Cache work
|
||||||
|
$GLOBALS['egw_info']['server']['temp_dir'] = '/tmp';
|
||||||
|
$GLOBALS['egw_info']['server']['install_id'] = 'PHPUnit test';
|
Loading…
x
Reference in New Issue
Block a user