mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user