diff --git a/overrides/Runner/TestSuiteLoader.php b/overrides/Runner/TestSuiteLoader.php index e690e2b5..aaa894a0 100644 --- a/overrides/Runner/TestSuiteLoader.php +++ b/overrides/Runner/TestSuiteLoader.php @@ -43,11 +43,13 @@ use function array_values; use function basename; use function class_exists; use function get_declared_classes; + use Pest\TestCases\IgnorableTestCase; use Pest\TestSuite; use PHPUnit\Framework\TestCase; use ReflectionClass; use ReflectionException; + use function stripos; use function strlen; use function substr; diff --git a/src/Bootstrappers/BootFiles.php b/src/Bootstrappers/BootFiles.php index 5817c3a8..a3d1ee9d 100644 --- a/src/Bootstrappers/BootFiles.php +++ b/src/Bootstrappers/BootFiles.php @@ -5,7 +5,9 @@ declare(strict_types=1); namespace Pest\Bootstrappers; use Pest\Support\Str; + use function Pest\testDirectory; + use Pest\TestSuite; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; diff --git a/src/Expectations/EachExpectation.php b/src/Expectations/EachExpectation.php index df0cb1d0..c14b4c12 100644 --- a/src/Expectations/EachExpectation.php +++ b/src/Expectations/EachExpectation.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Pest\Expectations; use function expect; + use Pest\Expectation; /** diff --git a/src/Laravel/Commands/PestDatasetCommand.php b/src/Laravel/Commands/PestDatasetCommand.php index 0a7847e7..df225ee9 100644 --- a/src/Laravel/Commands/PestDatasetCommand.php +++ b/src/Laravel/Commands/PestDatasetCommand.php @@ -8,7 +8,9 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; use Pest\Exceptions\InvalidConsoleArgument; + use function Pest\testDirectory; + use Pest\TestSuite; /** diff --git a/src/Laravel/Commands/PestInstallCommand.php b/src/Laravel/Commands/PestInstallCommand.php index 75f6dd54..fb6275ce 100644 --- a/src/Laravel/Commands/PestInstallCommand.php +++ b/src/Laravel/Commands/PestInstallCommand.php @@ -8,7 +8,9 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Pest\Console\Thanks; use Pest\Exceptions\InvalidConsoleArgument; + use function Pest\testDirectory; + use Pest\TestSuite; /** diff --git a/src/Laravel/Commands/PestTestCommand.php b/src/Laravel/Commands/PestTestCommand.php index ee18e076..aa67459e 100644 --- a/src/Laravel/Commands/PestTestCommand.php +++ b/src/Laravel/Commands/PestTestCommand.php @@ -8,7 +8,9 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Pest\Exceptions\InvalidConsoleArgument; use Pest\Support\Str; + use function Pest\testDirectory; + use Pest\TestSuite; /** diff --git a/src/PendingCalls/UsesCall.php b/src/PendingCalls/UsesCall.php index cb3fdc8c..df6b6dcb 100644 --- a/src/PendingCalls/UsesCall.php +++ b/src/PendingCalls/UsesCall.php @@ -58,7 +58,7 @@ final class UsesCall */ public function in(string ...$targets): void { - $targets = array_map(function ($path): string { + $targets = array_map(function ($path): string { $startChar = DIRECTORY_SEPARATOR; if ('\\' === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $path) > 0) { diff --git a/src/Repositories/DatasetsRepository.php b/src/Repositories/DatasetsRepository.php index 385d4d47..931db736 100644 --- a/src/Repositories/DatasetsRepository.php +++ b/src/Repositories/DatasetsRepository.php @@ -9,7 +9,9 @@ use Pest\Exceptions\DatasetAlreadyExist; use Pest\Exceptions\DatasetDoesNotExist; use Pest\Exceptions\ShouldNotHappen; use SebastianBergmann\Exporter\Exporter; + use function sprintf; + use Traversable; /** diff --git a/tests/Features/Expect/sequence.php b/tests/Features/Expect/sequence.php index 4f11b3a3..4b877a5e 100644 --- a/tests/Features/Expect/sequence.php +++ b/tests/Features/Expect/sequence.php @@ -40,8 +40,14 @@ test('fails if the number of iterable items is greater than the number of expect test('it works with associative arrays', function () { expect(['foo' => 'bar', 'baz' => 'boom']) ->sequence( - function ($expectation, $key) { $expectation->toEqual('bar'); $key->toEqual('foo'); }, - function ($expectation, $key) { $expectation->toEqual('boom'); $key->toEqual('baz'); }, + function ($expectation, $key) { + $expectation->toEqual('bar'); + $key->toEqual('foo'); + }, + function ($expectation, $key) { + $expectation->toEqual('boom'); + $key->toEqual('baz'); + }, ); }); diff --git a/tests/PHPUnit/CustomTestCase/CustomTestCase.php b/tests/PHPUnit/CustomTestCase/CustomTestCase.php index 8a71327b..6de89808 100644 --- a/tests/PHPUnit/CustomTestCase/CustomTestCase.php +++ b/tests/PHPUnit/CustomTestCase/CustomTestCase.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Tests\CustomTestCase; use function PHPUnit\Framework\assertTrue; + use PHPUnit\Framework\TestCase; abstract class CustomTestCase extends TestCase diff --git a/tests/PHPUnit/CustomTestCase/ExecutedTest.php b/tests/PHPUnit/CustomTestCase/ExecutedTest.php index 71a32980..00e759bb 100644 --- a/tests/PHPUnit/CustomTestCase/ExecutedTest.php +++ b/tests/PHPUnit/CustomTestCase/ExecutedTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Tests\CustomTestCase; use function PHPUnit\Framework\assertTrue; + use PHPUnit\Framework\TestCase; class ExecutedTest extends TestCase diff --git a/tests/Unit/Plugins/Version.php b/tests/Unit/Plugins/Version.php index 211f11e3..ffb076c7 100644 --- a/tests/Unit/Plugins/Version.php +++ b/tests/Unit/Plugins/Version.php @@ -1,7 +1,9 @@ fetch()); } - $output = function () { + $output = function () { $process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help'])); $process->run(); diff --git a/tests/Visual/SingleTestOrDirectory.php b/tests/Visual/SingleTestOrDirectory.php index ef5ab6fa..d3b07144 100644 --- a/tests/Visual/SingleTestOrDirectory.php +++ b/tests/Visual/SingleTestOrDirectory.php @@ -2,7 +2,7 @@ use Symfony\Component\Process\Process; -$run = function (string $target, $decorated = false) { +$run = function (string $target, $decorated = false) { $process = new Process(['php', 'bin/pest', $target], dirname(__DIR__, 2)); $process->run(); @@ -10,7 +10,7 @@ $run = function (string $target, $decorated = false) { return $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput()); }; -$snapshot = function ($name) { +$snapshot = function ($name) { $testsPath = dirname(__DIR__); return file_get_contents(implode(DIRECTORY_SEPARATOR, [ diff --git a/tests/Visual/Success.php b/tests/Visual/Success.php index c64344f5..d5939730 100644 --- a/tests/Visual/Success.php +++ b/tests/Visual/Success.php @@ -8,7 +8,7 @@ test('visual snapshot of test suite on success', function () { 'success.txt', ]); - $output = function () use ($testsPath) { + $output = function () use ($testsPath) { $process = (new Symfony\Component\Process\Process(['php', 'bin/pest'], dirname($testsPath), ['EXCLUDE' => 'integration', 'REBUILD_SNAPSHOTS' => false, 'PARATEST' => 0])); $process->run();