mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
Move tests into app/tests subdirectory (not app/inc/test or app/test)
This commit is contained in:
parent
4d4658e711
commit
237d81ce36
@ -18,7 +18,7 @@ use EGroupware\Api\Db;
|
||||
use EGroupware\Api\Db\Schema;
|
||||
|
||||
// test base providing Egw environment
|
||||
require_once realpath(__DIR__.'/../../test/LoggedInTest.php');
|
||||
require_once realpath(__DIR__.'/../../../tests/LoggedInTest.php');
|
||||
|
||||
// For security reasons we exit by default if called via the webserver
|
||||
if (php_sapi_name() !== 'cli')
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
use EGroupware\Api\DateTime;
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
@ -172,7 +172,7 @@ class FloatTest extends \EGroupware\Api\Etemplate\WidgetBaseTest {
|
||||
$content = static::$mocked_exec_result;
|
||||
static::$mocked_exec_result = array();
|
||||
|
||||
return $this->validateTest($content,
|
||||
return $this->validateTest($content,
|
||||
$error ? array() : array('widget' => $value),
|
||||
$error ? array('widget' => $error) : array()
|
||||
);
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
@ -172,7 +172,7 @@ class IntegerTest extends \EGroupware\Api\Etemplate\WidgetBaseTest {
|
||||
$content = static::$mocked_exec_result;
|
||||
static::$mocked_exec_result = array();
|
||||
|
||||
return $this->validateTest($content,
|
||||
return $this->validateTest($content,
|
||||
$error ? array() : array('widget' => $value),
|
||||
$error ? array('widget' => $error) : array()
|
||||
);
|
@ -5,14 +5,14 @@
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @author Nathan Gray
|
||||
* @package
|
||||
* @package
|
||||
* @copyright (c) 2017 Nathan Gray
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
*/
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
@ -52,7 +52,7 @@ class SelectTest extends \EGroupware\Api\Etemplate\WidgetBaseTest
|
||||
'Ψ'=> 'ψ Psi',
|
||||
'Ω'=> 'ω Omega',
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Test the widget's basic functionality - we put data in, it comes back
|
||||
* unchanged.
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
/**
|
||||
* Description of TemplateTest
|
||||
@ -64,7 +64,7 @@ class TemplateTest extends \EGroupware\Api\Etemplate\WidgetBaseTest {
|
||||
static $template = 'api.nested.sub_template';
|
||||
$template = Template::instance($template, 'test');
|
||||
$this->assertInstanceOf('EGroupware\Api\Etemplate\Widget\Template', $template);
|
||||
|
||||
|
||||
// Check for the sub-child to see if the template was loaded
|
||||
$this->assertInstanceOf('EGroupware\Api\Etemplate\Widget', $template->getElementById('sub_child'));
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
@ -21,7 +21,7 @@ class TextboxTest extends \EGroupware\Api\Etemplate\WidgetBaseTest
|
||||
{
|
||||
|
||||
const TEST_TEMPLATE = 'api.textbox_test';
|
||||
|
||||
|
||||
/**
|
||||
* Test the widget's basic functionallity - we put data in, it comes back
|
||||
* unchanged.
|
||||
@ -131,7 +131,7 @@ class TextboxTest extends \EGroupware\Api\Etemplate\WidgetBaseTest
|
||||
'widget_readonly' => 'World'
|
||||
);
|
||||
$result = $this->mockedExec($etemplate, $content, array(), array(), array());
|
||||
|
||||
|
||||
// Only lowercase
|
||||
$etemplate->getElementById('widget')->attrs['validator'] = '/^[a-z]*$/';
|
||||
|
||||
@ -154,7 +154,7 @@ class TextboxTest extends \EGroupware\Api\Etemplate\WidgetBaseTest
|
||||
|
||||
$content = static::$mocked_exec_result;
|
||||
static::$mocked_exec_result = array();
|
||||
|
||||
|
||||
return $this->validateTest($content, $error ? array() : array('widget' => $value), $error ? array('widget' => $error) : array());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace EGroupware\Api\Etemplate\Widget;
|
||||
|
||||
require_once realpath(__DIR__.'/../../test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../../tests/WidgetBaseTest.php');
|
||||
|
||||
use EGroupware\Api\Etemplate;
|
||||
|
||||
@ -125,7 +125,7 @@ class UrlTest extends \EGroupware\Api\Etemplate\WidgetBaseTest
|
||||
array('http://1337.net'),
|
||||
array('http://a.b-c.de'),
|
||||
array('http://223.255.255.254'),
|
||||
*
|
||||
*
|
||||
*/
|
||||
);
|
||||
}
|
@ -15,7 +15,7 @@ namespace EGroupware\Api\Etemplate;
|
||||
use Egroupware\Api\Etemplate;
|
||||
|
||||
// test base providing Egw environment, since we need the DB
|
||||
require_once realpath(__DIR__.'/../../test/LoggedInTest.php');
|
||||
require_once realpath(__DIR__.'/../../../tests/LoggedInTest.php');
|
||||
|
||||
// Store request in the session, file access probably won't work due to permissions
|
||||
\EGroupware\Api\Etemplate\Request::$request_class = 'EGroupware\Api\Etemplate\Request\Session';
|
||||
@ -92,7 +92,7 @@ abstract class WidgetBaseTest extends \EGroupware\Api\LoggedInTest {
|
||||
|
||||
// Store & clean the request
|
||||
//$etemplate->destroy_request();
|
||||
|
||||
|
||||
ob_end_clean();
|
||||
|
||||
return $result;
|
||||
@ -165,7 +165,7 @@ abstract class WidgetBaseTest extends \EGroupware\Api\LoggedInTest {
|
||||
* against $expected_values. Optionally, it can check that validation errors
|
||||
* are created by particular widgets.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param \EGroupware\Api\Etemplate $etemplate
|
||||
* @param array $content
|
||||
* @param array $set_values
|
||||
@ -210,7 +210,7 @@ abstract class WidgetBaseTest extends \EGroupware\Api\LoggedInTest {
|
||||
* $validation_errors actually did raise a validation error.
|
||||
*
|
||||
* Note that in most (all?) cases, a validation error will clear the value.
|
||||
*
|
||||
*
|
||||
* @param array $content
|
||||
* @param array $expected_values
|
||||
* @param array $validation_errors
|
@ -14,8 +14,6 @@
|
||||
|
||||
namespace EGroupware\Api;
|
||||
|
||||
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
|
||||
|
||||
use EGroupware\Api;
|
||||
use PHPUnit\Framework\TestCase as TestCase;
|
||||
use ReflectionClass;
|
@ -11,8 +11,6 @@
|
||||
*/
|
||||
namespace EGroupware\Api;
|
||||
|
||||
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
|
||||
|
||||
use PHPUnit\Framework\TestCase as TestCase;
|
||||
|
||||
/**
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace EGroupware\Api;
|
||||
|
||||
require_once realpath(__DIR__.'/../Etemplate/test/WidgetBaseTest.php');
|
||||
require_once realpath(__DIR__.'/../src/Etemplate/tests/WidgetBaseTest.php');
|
||||
|
||||
/**
|
||||
* Test the main class of Etemplate
|
@ -13,8 +13,6 @@
|
||||
|
||||
namespace EGroupware\Api;
|
||||
|
||||
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
|
||||
|
||||
use EGroupware\Api\Framework;
|
||||
use PHPUnit\Framework\TestCase as TestCase;
|
||||
|
@ -14,8 +14,6 @@
|
||||
|
||||
namespace EGroupware\Api;
|
||||
|
||||
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
|
||||
|
||||
use PHPUnit\Framework\TestCase as TestCase;
|
||||
use EGroupware\Api;
|
||||
|
||||
@ -136,7 +134,7 @@ abstract class LoggedInTest extends TestCase
|
||||
|
||||
try
|
||||
{
|
||||
include(realpath(__DIR__ . '/../../../header.inc.php'));
|
||||
include(realpath(__DIR__ . '/../../header.inc.php'));
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
@ -146,7 +144,7 @@ abstract class LoggedInTest extends TestCase
|
||||
return;
|
||||
}
|
||||
|
||||
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
|
||||
require_once realpath(__DIR__.'/../src/loader/common.php'); // autoloader & check_load_extension
|
||||
|
||||
// egw is normally created when a file is loaded using require_once
|
||||
if(empty($GLOBALS['egw']) || !is_a($GLOBALS['egw'], 'EGroupware\Api\Egw\Base'))
|
@ -13,7 +13,7 @@
|
||||
|
||||
namespace EGroupware\calendar;
|
||||
|
||||
require_once realpath(__DIR__.'/../../api/src/test/AppTest.php'); // Application test base
|
||||
require_once realpath(__DIR__.'/../../api/tests/AppTest.php'); // Application test base
|
||||
|
||||
use Egroupware\Api;
|
||||
|
@ -12,21 +12,17 @@
|
||||
</php>
|
||||
<testsuites>
|
||||
<testsuite name="Api">
|
||||
<directory>../api/tests</directory>
|
||||
<directory>../api/src/test/</directory>
|
||||
<directory>../api/src/*/test/</directory>
|
||||
<directory>../api/tests</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Etemplate">
|
||||
<file>../api/src/test/EtemplateTest.php</file>
|
||||
<directory>../api/src/Etemplate/test/</directory>
|
||||
<directory>../api/src/Etemplate/Widget/test/</directory>
|
||||
<file>../api/src/tests/EtemplateTest.php</file>
|
||||
<directory>../api/src/Etemplate/tests/</directory>
|
||||
<directory>../api/src/Etemplate/Widget/tests/</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Apps">
|
||||
<!-- Apps with test directory -->
|
||||
<directory>../*/test/</directory>
|
||||
<!-- Apps with namespace -->
|
||||
<directory>../*/src/test/</directory>
|
||||
<directory>../*/src/*/test/</directory>
|
||||
<directory>../*/tests/</directory>
|
||||
|
||||
<exclude>../api</exclude>
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace EGroupware\Infolog;
|
||||
|
||||
require_once realpath(__DIR__.'/../../api/src/test/AppTest.php'); // Application test base
|
||||
require_once realpath(__DIR__.'/../../api/tests/AppTest.php'); // Application test base
|
||||
|
||||
use Egroupware\Api\Contacts;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace EGroupware\Infolog;
|
||||
|
||||
require_once realpath(__DIR__.'/../../api/src/test/AppTest.php'); // Application test base
|
||||
require_once realpath(__DIR__.'/../../api/tests/AppTest.php'); // Application test base
|
||||
|
||||
use Egroupware\Api;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
namespace EGroupware\Infolog;
|
||||
|
||||
require_once realpath(__DIR__.'/../../api/src/test/AppTest.php'); // Application test base
|
||||
require_once realpath(__DIR__.'/../../api/tests/AppTest.php'); // Application test base
|
||||
|
||||
use Egroupware\Api;
|
||||
|
Loading…
Reference in New Issue
Block a user