Move tests into app/tests subdirectory (not app/inc/test or app/test)

This commit is contained in:
nathangray 2017-10-18 15:43:35 +02:00
parent 4d4658e711
commit 237d81ce36
25 changed files with 33 additions and 45 deletions

View File

@ -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')

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -11,8 +11,6 @@
*/
namespace EGroupware\Api;
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
use PHPUnit\Framework\TestCase as TestCase;
/**

View File

@ -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

View File

@ -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;

View File

@ -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'))

View File

@ -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;

View File

@ -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>

View File

@ -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;

View File

@ -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;

View File

@ -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;