mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
make test directory configurable
This commit is contained in:
@ -18,7 +18,7 @@ test('default php unit tests', function () {
|
||||
$testSuite->addTest($phpUnitTestCase);
|
||||
expect($testSuite->tests())->toHaveCount(1);
|
||||
|
||||
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd()));
|
||||
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd(), 'tests'));
|
||||
expect($testSuite->tests())->toHaveCount(1);
|
||||
});
|
||||
|
||||
@ -27,6 +27,6 @@ it('removes warnings', function () {
|
||||
$warningTestCase = new WarningTestCase('No tests found in class "Pest\TestCase".');
|
||||
$testSuite->addTest($warningTestCase);
|
||||
|
||||
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd()));
|
||||
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd(), 'tests'));
|
||||
expect($testSuite->tests())->toHaveCount(0);
|
||||
});
|
||||
|
||||
@ -38,6 +38,7 @@ it('creates an instance and resolves also sub parameters', function () {
|
||||
|
||||
it('can resolve builtin value types', function () {
|
||||
$this->container->add('rootPath', getcwd());
|
||||
$this->container->add('testPath', 'tests');
|
||||
|
||||
$instance = $this->container->get(TestSuite::class);
|
||||
expect($instance)->toBeInstanceOf(TestSuite::class);
|
||||
|
||||
@ -4,7 +4,7 @@ use Pest\Exceptions\TestAlreadyExist;
|
||||
use Pest\TestSuite;
|
||||
|
||||
it('does not allow to add the same test description twice', function () {
|
||||
$testSuite = new TestSuite(getcwd());
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
$test = function () {};
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$this->expectException(TestAlreadyExist::class);
|
||||
|
||||
Reference in New Issue
Block a user