Start names of special directories with dot

BaseTestCase - add setter for path of directory with data used by test cases
This commit is contained in:
Meritoo
2017-10-17 20:49:13 +02:00
parent 70c273750d
commit 71e1eeb81b
11 changed files with 38 additions and 21 deletions

View File

@@ -25,6 +25,13 @@ use ReflectionMethod;
*/
abstract class BaseTestCase extends TestCase
{
/**
* Path of directory with data used by test cases
*
* @var string
*/
private static $testsDataDirPath = '.data/tests';
/**
* Provides an empty value
*
@@ -98,7 +105,7 @@ abstract class BaseTestCase extends TestCase
/**
* Returns path of file used by tests.
* It should be placed in /data/tests directory of this project.
* It should be placed in /.data/tests directory of this project.
*
* @param string $fileName Name of file
* @param string $directoryPath (optional) Path of directory containing the file
@@ -110,7 +117,7 @@ abstract class BaseTestCase extends TestCase
$paths = [
$rootPath,
'data/tests',
self::$testsDataDirPath,
$directoryPath,
$fileName,
];
@@ -218,4 +225,14 @@ abstract class BaseTestCase extends TestCase
static::assertNull($constructor);
}
/**
* Sets path of directory with data used by test cases
*
* @param string $testsDataDirPath Path of directory with data used by test cases
*/
protected static function setTestsDataDirPath($testsDataDirPath)
{
static::$testsDataDirPath = $testsDataDirPath;
}
}