N°3091 Update PHPUnit to 8.5 : fix setUp and teardDown methods signatures

"Return type declaration must be compatible with parent"
See https://phpunit.de/announcements/phpunit-8.html "Return Type of Template Methods"
This commit is contained in:
Pierre Goiffon
2022-04-21 10:37:07 +02:00
parent cacf0004a5
commit ec143c43db
50 changed files with 101 additions and 176 deletions

View File

@@ -77,7 +77,7 @@ class ItopDataTestCase extends ItopTestCase
/**
* @throws Exception
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'/application/startup.inc.php');
@@ -101,15 +101,12 @@ class ItopDataTestCase extends ItopTestCase
/**
* @throws Exception
*/
protected function tearDown()
protected function tearDown(): void
{
if (static::USE_TRANSACTION)
{
if (static::USE_TRANSACTION) {
$this->debug("ROLLBACK !!!");
CMDBSource::Query('ROLLBACK');
}
else
{
} else {
$this->debug("");
$this->aCreatedObjects = array_reverse($this->aCreatedObjects);
foreach ($this->aCreatedObjects as $oObject)

View File

@@ -34,10 +34,11 @@ class ItopTestCase extends TestCase
{
const TEST_LOG_DIR = 'test';
protected function setUp()
/** @noinspection UsingInclusionOnceReturnValueInspection avoid errors for approot includes */
protected function setUp(): void
{
@include_once '../approot.inc.php';
@include_once '../../approot.inc.php';
@include_once '../../approot.inc.php';
@include_once '../../../approot.inc.php';
@include_once '../../../../approot.inc.php';
@include_once '../../../../../approot.inc.php';
@@ -45,7 +46,7 @@ class ItopTestCase extends TestCase
@include_once '../../../../../../../approot.inc.php';
@include_once '../../../../../../../../approot.inc.php';
$this->debug("\n----------\n---------- ".$this->getName()."\n----------\n");
$this->debug("\n----------\n---------- ".$this->getName()."\n----------\n");
}
@@ -57,9 +58,9 @@ class ItopTestCase extends TestCase
{
echo "$sMsg\n";
}
else
{
print_r($sMsg);
else {
/** @noinspection ForgottenDebugOutputInspection */
print_r($sMsg);
}
}
}

View File

@@ -17,10 +17,10 @@ class DataLocalizerTest extends ItopDataTestCase
const USE_TRANSACTION = false;
const TEST_CSV_RESULT = 'DataLocalizerTest.csv';
public function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
ApplicationContext::SetPluginProperty('QueryLocalizerPlugin', 'language_code', 'FR FR');
SetupUtils::builddir(APPROOT.'log/test/OQLToSQL');

View File

@@ -22,10 +22,9 @@ class OQLToSQLAllCLassesTest extends ItopDataTestCase
{
const USE_TRANSACTION = false;
public function setUp()
public function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
SetupUtils::builddir(APPROOT.'log/test/OQLToSQL');
}

View File

@@ -17,10 +17,9 @@ class OQLToSQLTest extends ItopDataTestCase
const USE_TRANSACTION = false;
const TEST_CSV_RESULT = 'OQLToSQLTest.csv';
public function setUp()
public function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
SetupUtils::builddir(APPROOT.'log/test/OQLToSQL');
}

View File

@@ -22,10 +22,9 @@ class OQLToSQLNestedSelectTest extends ItopDataTestCase
const USE_TRANSACTION = false;
const TEST_CSV_RESULT = 'OQLToSQLTest.csv';
public function setUp()
public function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
SetupUtils::builddir(APPROOT.'log/test/OQLToSQL');
}

View File

@@ -22,10 +22,9 @@ class OQLToSQLTest extends ItopDataTestCase
const USE_TRANSACTION = false;
const TEST_CSV_RESULT = 'OQLToSQLTest.csv';
public function setUp()
public function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
SetupUtils::builddir(APPROOT.'log/test/OQLToSQL');
}

View File

@@ -24,13 +24,6 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
*/
class DashboardLayoutTest extends ItopTestCase
{
public function setUp()
{
parent::setUp();
require_once APPROOT.'application/dashboardlayout.class.inc.php';
}
/**
* @return array
*/

View File

@@ -24,12 +24,6 @@
*/
class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
{
public function setUp()
{
parent::setUp();
require_once(APPROOT.'application/utils.inc.php');
}
public function testEndsWith()
{
$this->assertFalse(utils::EndsWith('a', 'bbbb'));

View File

@@ -27,7 +27,7 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase;
class iTopComposerTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
clearstatcache();

View File

@@ -32,13 +32,6 @@ class privUITransactionFileTest extends ItopDataTestCase
const USER1_TEST_LOGIN = 'user1_support_test_privUITransaction';
const USER2_TEST_LOGIN = 'user2_support_test_privUITransaction';
public function setUp()
{
parent::setUp();
require_once(APPROOT.'/application/startup.inc.php');
// require_once(APPROOT.'application/utils.inc.php');
}
/**
* @dataProvider cleanupOldTransactionsProvider
*/

View File

@@ -50,16 +50,6 @@ class CriterionConversionTest extends ItopDataTestCase
{
const CREATE_TEST_ORG = true;
/**
* @throws \Exception
*/
protected function setUp()
{
parent::setUp();
require_once(APPROOT."sources/application/search/criterionconversionabstract.class.inc.php");
}
/**
* @dataProvider ToOqlProvider
*

View File

@@ -29,23 +29,15 @@
namespace Combodo\iTop\Test\UnitTest\Application\Search;
use Combodo\iTop\Application\Search\CriterionParser;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @backupGlobals disabled
*/
class CriterionParserTest extends ItopTestCase
class CriterionParserTest extends ItopDataTestCase
{
protected function setUp()
{
parent::setUp();
require_once(APPROOT."application/startup.inc.php");
require_once(APPROOT."sources/application/search/criterionparser.class.inc.php");
}
public function testParse()
{
$sBaseOql = 'SELECT UserRequest';

View File

@@ -36,16 +36,6 @@ class SearchFormTest extends ItopDataTestCase
{
const CREATE_TEST_ORG = true;
/**
* @throws Exception
*/
protected function setUp()
{
parent::setUp();
require_once(APPROOT."sources/application/search/searchform.class.inc.php");
}
/**
* @dataProvider GetFieldsProvider
* @throws \OQLException

View File

@@ -2,8 +2,8 @@
namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use CMDBSource;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use MetaModel;
/**
@@ -14,7 +14,8 @@ use MetaModel;
class BulkChangeTest extends ItopDataTestCase {
const CREATE_TEST_ORG = true;
protected function setUp() {
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'core/coreexception.class.inc.php');
require_once(APPROOT.'core/bulkchange.class.inc.php');

View File

@@ -20,7 +20,7 @@ use utils;
*/
class CMDBSourceTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@@ -26,10 +26,10 @@ class TransactionsTest extends ItopTestCase
/** @var DeadLockInjection */
private $oMySQLiMock;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once ('DeadLockInjection.php');
require_once('DeadLockInjection.php');
require_once(APPROOT.'/core/cmdbsource.class.inc.php');
$sEnv = 'production';
$sConfigFile = APPCONF.$sEnv.'/config-itop.php';

View File

@@ -23,7 +23,6 @@ namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use ConfigPlaceholdersResolver;
use PHPUnit\Framework\TestCase;
/**
* @runTestsInSeparateProcesses
@@ -32,10 +31,10 @@ use PHPUnit\Framework\TestCase;
*/
class ConfigPlaceholdersResolverTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once (APPROOT.'core/config.class.inc.php');
require_once(APPROOT.'core/config.class.inc.php');
}
/**
* @dataProvider providerResolve

View File

@@ -23,19 +23,18 @@ namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use Config;
use PHPUnit\Framework\TestCase;
/**
/**
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @backupGlobals disabled
*/
class ConfigTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once (APPROOT.'core/config.class.inc.php');
require_once(APPROOT.'core/config.class.inc.php');
}
/**

View File

@@ -40,7 +40,7 @@ class DBObjectTest extends ItopDataTestCase
{
const CREATE_TEST_ORG = true;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'core/coreexception.class.inc.php');

View File

@@ -18,7 +18,7 @@ use DBSearch;
class DBSearchIntersectTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');

View File

@@ -19,7 +19,7 @@ class DBSearchJoinTest extends ItopDataTestCase {
const USE_TRANSACTION = false;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');

View File

@@ -53,7 +53,7 @@ class DBSearchTest extends ItopDataTestCase
/**
* @throws \Exception
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@@ -19,7 +19,7 @@ class DBSearchUpdateRealiasingMapTest extends ItopDataTestCase
{
const USE_TRANSACTION = false;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');

View File

@@ -17,7 +17,7 @@ class LogAPITest extends ItopTestCase
private $mockFileLog;
private $oMetaModelConfig;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->mockFileLog = $this->createMock('FileLog');

View File

@@ -25,21 +25,20 @@ class LogFileNameBuilderTest extends ItopTestCase
clearstatcache(true, $sLogFile);
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once APPROOT.'core/log.class.inc.php';
}
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();
// remove log files created in the test
$aTestLogFiles = glob(__DIR__.DIRECTORY_SEPARATOR.self::TEST_LOGFILE_PREFIX.'*.'.self::TEST_LOGFILE_EXTENSION);
foreach ($aTestLogFiles as $sLogFile)
{
foreach ($aTestLogFiles as $sLogFile) {
unlink($sLogFile);
}
}

View File

@@ -23,7 +23,7 @@ class MetaModelTest extends ItopDataTestCase
protected static $sDefaultUserRequestTitle = 'Unit test title';
protected static $sDefaultUserRequestDescription = 'Unit test description';
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once APPROOT.'/core/metamodel.class.php';

View File

@@ -2,11 +2,9 @@
namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Portal\Controller\ObjectController;
use Combodo\iTop\Test\UnitTest\ItopDataTestCase;
use ContextTag;
use MetaModel;
use PHPUnit\Exception;
use TriggerOnObjectCreate;
/**
@@ -22,7 +20,7 @@ class TriggerTest extends ItopDataTestCase
const USE_TRANSACTION = false;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
}

View File

@@ -16,7 +16,7 @@ use MetaModel;
*/
class UniquenessConstraintTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'/core/metamodel.class.php');

View File

@@ -36,16 +36,15 @@ use UserRights;
*/
class UserRightsTest extends ItopDataTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
try{
\utils::GetConfig()->SetModuleSetting('authent-local', 'password_validation.pattern', '' );
try {
\utils::GetConfig()->SetModuleSetting('authent-local', 'password_validation.pattern', '');
self::CreateUser('admin', 1);
}
catch(\CoreCannotSaveObjectException $e)
{
catch (\CoreCannotSaveObjectException $e) {
}
}

View File

@@ -7,7 +7,7 @@ use DateTime;
class WeeklyScheduledProcessTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'core/backgroundprocess.inc.php');

View File

@@ -27,7 +27,6 @@
namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use PHPUnit\Framework\TestCase;
define('UNIT_MAX_CACHE_FILES', 10);
@@ -40,7 +39,7 @@ define('UNIT_MAX_CACHE_FILES', 10);
class apcEmulationTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'core/apc-emulation.php');
@@ -48,7 +47,7 @@ class apcEmulationTest extends ItopTestCase
apc_clear_cache();
}
public function tearDown()
public function tearDown(): void
{
apc_clear_cache();
}

View File

@@ -28,7 +28,6 @@ namespace Combodo\iTop\Test\UnitTest\Core;
use Combodo\iTop\Test\UnitTest\ItopTestCase;
use Dict;
use Exception;
/**
@@ -42,12 +41,12 @@ class dictApcuTest extends ItopTestCase
private $oApcService;
private $sDictionaryFolder;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once (APPROOT.'core' . DIRECTORY_SEPARATOR . 'coreexception.class.inc.php');
require_once (APPROOT.'core' . DIRECTORY_SEPARATOR . 'dict.class.inc.php');
require_once (APPROOT.'core' . DIRECTORY_SEPARATOR . 'apc-service.class.inc.php');
require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'coreexception.class.inc.php');
require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'dict.class.inc.php');
require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php');
$this->sEnvName = time();
$_SESSION['itop_env'] = $this->sEnvName;
@@ -110,12 +109,12 @@ PHP;
file_put_contents($sDictionaryFolder . DIRECTORY_SEPARATOR . "$sLanguageCodeInFilename.dict.php", $sContent);
}
protected function tearDown()
protected function tearDown(): void
{
foreach (glob(APPROOT."env-$this->sEnvName" . DIRECTORY_SEPARATOR . "dictionaries" . DIRECTORY_SEPARATOR . "*") as $sFile){
foreach (glob(APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries".DIRECTORY_SEPARATOR."*") as $sFile) {
unlink($sFile);
}
rmdir(APPROOT."env-$this->sEnvName" . DIRECTORY_SEPARATOR . "dictionaries");
rmdir(APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries");
rmdir(APPROOT."env-$this->sEnvName");
}

View File

@@ -39,14 +39,14 @@ use Exception;
class dictTest extends ItopTestCase
{
private $sEnvName;
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once (APPROOT.'core'. DIRECTORY_SEPARATOR . 'coreexception.class.inc.php');
require_once (APPROOT.'core'. DIRECTORY_SEPARATOR . 'dict.class.inc.php');
require_once (APPROOT.'core'. DIRECTORY_SEPARATOR . 'apc-service.class.inc.php');
require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'coreexception.class.inc.php');
require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'dict.class.inc.php');
require_once(APPROOT.'core'.DIRECTORY_SEPARATOR.'apc-service.class.inc.php');
$this->sEnvName = time();
$sDictionaryFolder = APPROOT."env-$this->sEnvName" . DIRECTORY_SEPARATOR . "dictionaries";
$sDictionaryFolder = APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries";
@mkdir($sDictionaryFolder, 0777, true);
$sContent = <<<PHP
@@ -74,12 +74,12 @@ PHP;
//require_once 'mockDict.incphp';
}
protected function tearDown()
protected function tearDown(): void
{
foreach (glob(APPROOT."env-$this->sEnvName" . DIRECTORY_SEPARATOR . "dictionaries" . DIRECTORY_SEPARATOR . "*") as $sFile){
foreach (glob(APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries".DIRECTORY_SEPARATOR."*") as $sFile) {
unlink($sFile);
}
rmdir(APPROOT."env-$this->sEnvName" . DIRECTORY_SEPARATOR . "dictionaries");
rmdir(APPROOT."env-$this->sEnvName".DIRECTORY_SEPARATOR."dictionaries");
rmdir(APPROOT."env-$this->sEnvName");
}

View File

@@ -13,14 +13,14 @@ class iTopConfigParserTest extends ItopTestCase
private $tmpSavePath;
private $sConfigPath;
public function setUp()
public function setUp(): void
{
parent::setUp();
require_once APPROOT.'/core/iTopConfigParser.php';
clearstatcache();
$this->sConfigPath = utils::GetConfigFilePath();
$this->tmpSavePath = tempnam( '/tmp/', 'config-itop');
$this->tmpSavePath = tempnam('/tmp/', 'config-itop');
$this->conf_exists = is_file($this->sConfigPath);
if ($this->conf_exists)
@@ -30,11 +30,10 @@ class iTopConfigParserTest extends ItopTestCase
clearstatcache();
}
public function tearDown()
public function tearDown(): void
{
parent::tearDown(); // TODO: Change the autogenerated stub
if ($this->conf_exists)
{
if ($this->conf_exists) {
rename($this->tmpSavePath, $this->sConfigPath);
}
}

View File

@@ -47,9 +47,9 @@ class ormLinkSetTest extends ItopDataTestCase
/**
* @throws Exception
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();
parent::setUp();
}
/**

View File

@@ -49,7 +49,7 @@ class ormTagSetTest extends ItopDataTestCase
/**
* @throws Exception
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@@ -9,7 +9,7 @@ abstract class AbstractDOMSanitizerTest extends ItopTestCase
const INPUT_DIRECTORY = 'input';
const OUTPUT_DIRECTORY = 'output';
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/utils.inc.php');

View File

@@ -21,13 +21,12 @@ use UserLocal;
class UserLocalTest extends ItopDataTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
require_once (APPROOT.'test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php');
require_once (APPROOT.'env-production/authent-local/model.authent-local.php');
require_once(APPROOT.'test/coreExtensions/UserLocalTest/UserLocalPasswordPolicyMock.php');
require_once(APPROOT.'env-production/authent-local/model.authent-local.php');
}
/**

View File

@@ -29,7 +29,7 @@ use iTopDesignFormat;
*/
class iTopModulesXmlVersionIntegrationTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@@ -15,7 +15,7 @@ use PhpParser\PrettyPrinter\Standard;
class iTopConfigAstValidatorTest extends ItopTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

View File

@@ -16,7 +16,7 @@ use PhpParser\PrettyPrinter\Standard;
class iTopConfigSyntaxValidatorTest extends ItopTestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

View File

@@ -39,14 +39,6 @@ class ItopTicketTest extends ItopDataTestCase
{
const CREATE_TEST_ORG = true;
/**
* @throws Exception
*/
protected function setUp()
{
parent::setUp();
}
/**
* <pre>
* Given:

View File

@@ -17,7 +17,7 @@ use PHPUnit\Exception;
*/
class TestForITopDesignFormatClass extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();
@@ -148,6 +148,7 @@ class TestForITopDesignFormatClass extends ItopTestCase
{
if (is_dir($sPath))
{
/** @noinspection SlowArrayOperationsInLoopInspection */
$aDataModelFiles = array_merge($aDataModelFiles, $this->GetDataModelFiles($sPath));
}
else if (preg_match("/datamodel\..*\.xml/", basename($sPath)))

View File

@@ -147,6 +147,7 @@ class QueryLogEntry
$iRepeat = utils::ReadParam('repeat', 3);
try
{
$resQuery = null;
$fRefTime = MyHelpers::getmicrotime();
for($i = 0 ; $i < $iRepeat ; $i++)
{
@@ -167,7 +168,6 @@ class QueryLogEntry
catch (Exception $e)
{
$this->aErrors[] = "Failed to execute the SQL:".$e->getMessage();
$resQuery = null;
}
if ($resQuery)
{

View File

@@ -19,12 +19,10 @@ class DBBackupTest extends ItopTestCase
* @throws \MySQLException
* @throws \ConfigException
*/
protected function setUp()
protected function setUp(): void
{
parent::setUp();
require_once(APPROOT.'core/config.class.inc.php');
require_once(APPROOT.'setup/backup.class.inc.php');
require_once(APPROOT.'core/cmdbsource.class.inc.php'); // DBBackup dependency
// We need a connection to the DB, so let's open it !
// We are using the default config file... as the server might not be configured for all the combination we are testing

View File

@@ -17,7 +17,7 @@ use SetupUtils;
*/
class SetupUtilsTest extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@@ -17,7 +17,7 @@ use iTopDesignFormat;
*/
class TestForITopDesignFormatClass extends ItopTestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@@ -30,19 +30,16 @@ if (!defined('DEBUG_UNIT_TEST')) {
class StatusIncTest extends TestCase {
/**
*
* @var string
* @var string
*/
protected $sAppRoot = '';
/**
*
*/
protected function setUp() {
//AppRoot is the directory containing the directory
//Assume getcwd() is runned inside APPROOT/test
$this->sAppRoot = __DIR__ . '/../../sources/application/status';
}
protected function setUp(): void
{
//AppRoot is the directory containing the directory
//Assume getcwd() is runned inside APPROOT/test
$this->sAppRoot = __DIR__.'/../../sources/application/status';
}
/**
* @expectedException \Exception

View File

@@ -24,16 +24,16 @@ class RestTest extends ItopDataTestCase
/**
* @throws Exception
*/
protected function setUp()
{
parent::setUp();
require_once(APPROOT.'application/startup.inc.php');
$this->sLogin = "rest-user-" . date('dmYHis');
$this->CreateTestOrganization();
protected function setUp(): void
{
parent::setUp();
if (!empty($this->sTmpFile)){
unlink($this->sTmpFile);
}
$this->sLogin = "rest-user-".date('dmYHis');
$this->CreateTestOrganization();
if (!empty($this->sTmpFile)) {
unlink($this->sTmpFile);
}
$sConfigFile = \utils::GetConfig()->GetLoadedFile();
@chmod($sConfigFile, 0770);