Add TEST_PATH for out of source tests
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
826ca21e78
commit
7ec4ea0e66
@ -8,6 +8,14 @@ if (! defined('ROOT_PATH')) {
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
if (! defined('TEST_PATH')) {
|
||||
// This is used at Debian because tests
|
||||
// can be in a different place than the source code
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
define('TEST_PATH', ROOT_PATH);
|
||||
// phpcs:enable
|
||||
}
|
||||
|
||||
/**
|
||||
* Set precision to sane value, with higher values
|
||||
* things behave slightly unexpectedly, for example
|
||||
|
||||
@ -923,11 +923,11 @@ class ConfigTest extends AbstractTestCase
|
||||
{
|
||||
return [
|
||||
[
|
||||
ROOT_PATH . 'test/test_data/config.inc.php',
|
||||
TEST_PATH . 'test/test_data/config.inc.php',
|
||||
true,
|
||||
],
|
||||
[
|
||||
ROOT_PATH . 'test/test_data/config-nonexisting.inc.php',
|
||||
TEST_PATH . 'test/test_data/config-nonexisting.inc.php',
|
||||
false,
|
||||
],
|
||||
];
|
||||
|
||||
@ -28,7 +28,7 @@ class FileListingTest extends AbstractTestCase
|
||||
{
|
||||
$this->assertFalse($this->fileListing->getDirContent('nonexistent directory'));
|
||||
|
||||
$fixturesDir = ROOT_PATH . 'test/classes/_data/file_listing';
|
||||
$fixturesDir = TEST_PATH . 'test/classes/_data/file_listing';
|
||||
|
||||
$dirContent = $this->fileListing->getDirContent($fixturesDir);
|
||||
if (is_bool($dirContent)) {
|
||||
@ -46,7 +46,7 @@ class FileListingTest extends AbstractTestCase
|
||||
|
||||
public function testGetFileSelectOptions(): void
|
||||
{
|
||||
$fixturesDir = ROOT_PATH . 'test/classes/_data/file_listing';
|
||||
$fixturesDir = TEST_PATH . 'test/classes/_data/file_listing';
|
||||
|
||||
$this->assertFalse($this->fileListing->getFileSelectOptions('nonexistent directory'));
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ class ThemeTest extends AbstractTestCase
|
||||
*/
|
||||
public function testCheckImgPathFull(): void
|
||||
{
|
||||
$this->object->setFsPath(ROOT_PATH . 'test/classes/_data/gen_version_info/');
|
||||
$this->object->setFsPath(TEST_PATH . 'test/classes/_data/gen_version_info/');
|
||||
$this->assertTrue($this->object->loadInfo());
|
||||
$this->assertEquals('Test Theme', $this->object->getName());
|
||||
$this->assertEquals('5.1', $this->object->getVersion());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user