Loader
in package
Loads all Codeception supported test formats from a directory.
<?php
$testLoader = new \Codeception\TestLoader('tests/unit');
$testLoader->loadTests();
$tests = $testLoader->getTests();
?>
You can load specific file
<?php
$testLoader = new \Codeception\TestLoader('tests/unit');
$testLoader->loadTest('UserTest.php');
$testLoader->loadTest('PostTest.php');
$tests = $testLoader->getTests();
?>
or a subdirectory
<?php
$testLoader = new \Codeception\TestLoader('tests/unit');
$testLoader->loadTest('models'); // all tests from tests/unit/models
$tests = $testLoader->getTests();
?>
Table of Contents
Properties
Methods
- __construct() : mixed
- getTests() : mixed
- loadTest() : mixed
- loadTests() : mixed
- findPath() : mixed
- makePath() : mixed
- relativeName() : mixed
Properties
$formats
protected
mixed
$formats
= []
$path
protected
mixed
$path
$tests
protected
mixed
$tests
= []
Methods
__construct()
public
__construct(array<string|int, mixed> $suiteSettings) : mixed
Parameters
- $suiteSettings : array<string|int, mixed>
getTests()
public
getTests() : mixed
loadTest()
public
loadTest(mixed $path) : mixed
Parameters
- $path : mixed
loadTests()
public
loadTests([mixed $fileName = null ]) : mixed
Parameters
- $fileName : mixed = null
findPath()
protected
findPath(mixed $path) : mixed
Parameters
- $path : mixed
makePath()
protected
makePath(mixed $originalPath) : mixed
Parameters
- $originalPath : mixed
relativeName()
protected
relativeName(mixed $file) : mixed
Parameters
- $file : mixed