Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use only native PHPUnit test loader #500

Merged
merged 2 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/Runners/PHPUnit/SuiteLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ public function load(string $path = ''): void
$this->loadConfiguration();

if ($path !== '') {
$testFileLoader = new TestFileLoader($this->options);
$this->files = array_merge(
$this->files = array_merge(
$this->files,
$testFileLoader->loadPath($path)
(new Facade())->getFilesAsArray($path, ['Test.php'])
);
} elseif (
isset($this->options->parallelSuite)
Expand Down
163 changes: 0 additions & 163 deletions src/Runners/PHPUnit/TestFileLoader.php

This file was deleted.

7 changes: 3 additions & 4 deletions test/Unit/Runners/PHPUnit/SuiteLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace ParaTest\Tests\Unit\Runners\PHPUnit;

use InvalidArgumentException;
use ParaTest\Runners\PHPUnit\ExecutableTest;
use ParaTest\Runners\PHPUnit\Options;
use ParaTest\Runners\PHPUnit\Suite;
Expand Down Expand Up @@ -35,7 +34,7 @@ public function testOptionsCanBeNull(): void

public function testLoadThrowsExceptionWithInvalidPath(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectException(RuntimeException::class);

$loader = new SuiteLoader();
$loader->load('/path/to/nowhere');
Expand Down Expand Up @@ -200,7 +199,7 @@ public function testLoadSuiteFromConfigWithBadSuitePath(): void

public function testLoadFileGetsPathOfFile(): void
{
$path = $this->fixture('failing-tests/UnitTestWithClassAnnotationTest.php');
$path = $this->fixture('failing-tests' . DS . 'UnitTestWithClassAnnotationTest.php');
$paths = $this->getLoadedPaths($path);
static::assertEquals($path, array_shift($paths));
}
Expand All @@ -219,7 +218,7 @@ private function getLoadedPaths(string $path, ?SuiteLoader $loader = null): arra

public function testLoadFileShouldLoadFileWhereNameDoesNotEndInTest(): void
{
$path = $this->fixture('passing-tests/TestOfUnits.php');
$path = $this->fixture('passing-tests' . DS . 'TestOfUnits.php');
$paths = $this->getLoadedPaths($path);
static::assertEquals($path, array_shift($paths));
}
Expand Down
37 changes: 0 additions & 37 deletions test/Unit/Runners/PHPUnit/TestFileLoaderTest.php

This file was deleted.