mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 18:27:23 +01:00
fix lint
This commit is contained in:
@ -43,11 +43,13 @@ use function array_values;
|
|||||||
use function basename;
|
use function basename;
|
||||||
use function class_exists;
|
use function class_exists;
|
||||||
use function get_declared_classes;
|
use function get_declared_classes;
|
||||||
|
|
||||||
use Pest\TestCases\IgnorableTestCase;
|
use Pest\TestCases\IgnorableTestCase;
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use ReflectionClass;
|
use ReflectionClass;
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
|
|
||||||
use function stripos;
|
use function stripos;
|
||||||
use function strlen;
|
use function strlen;
|
||||||
use function substr;
|
use function substr;
|
||||||
|
|||||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
|||||||
namespace Pest\Bootstrappers;
|
namespace Pest\Bootstrappers;
|
||||||
|
|
||||||
use Pest\Support\Str;
|
use Pest\Support\Str;
|
||||||
|
|
||||||
use function Pest\testDirectory;
|
use function Pest\testDirectory;
|
||||||
|
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
use RecursiveDirectoryIterator;
|
use RecursiveDirectoryIterator;
|
||||||
use RecursiveIteratorIterator;
|
use RecursiveIteratorIterator;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Pest\Expectations;
|
namespace Pest\Expectations;
|
||||||
|
|
||||||
use function expect;
|
use function expect;
|
||||||
|
|
||||||
use Pest\Expectation;
|
use Pest\Expectation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -8,7 +8,9 @@ use Illuminate\Console\Command;
|
|||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Pest\Exceptions\InvalidConsoleArgument;
|
use Pest\Exceptions\InvalidConsoleArgument;
|
||||||
|
|
||||||
use function Pest\testDirectory;
|
use function Pest\testDirectory;
|
||||||
|
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -8,7 +8,9 @@ use Illuminate\Console\Command;
|
|||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Pest\Console\Thanks;
|
use Pest\Console\Thanks;
|
||||||
use Pest\Exceptions\InvalidConsoleArgument;
|
use Pest\Exceptions\InvalidConsoleArgument;
|
||||||
|
|
||||||
use function Pest\testDirectory;
|
use function Pest\testDirectory;
|
||||||
|
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -8,7 +8,9 @@ use Illuminate\Console\Command;
|
|||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Pest\Exceptions\InvalidConsoleArgument;
|
use Pest\Exceptions\InvalidConsoleArgument;
|
||||||
use Pest\Support\Str;
|
use Pest\Support\Str;
|
||||||
|
|
||||||
use function Pest\testDirectory;
|
use function Pest\testDirectory;
|
||||||
|
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -58,7 +58,7 @@ final class UsesCall
|
|||||||
*/
|
*/
|
||||||
public function in(string ...$targets): void
|
public function in(string ...$targets): void
|
||||||
{
|
{
|
||||||
$targets = array_map(function ($path): string {
|
$targets = array_map(function ($path): string {
|
||||||
$startChar = DIRECTORY_SEPARATOR;
|
$startChar = DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
if ('\\' === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $path) > 0) {
|
if ('\\' === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $path) > 0) {
|
||||||
|
|||||||
@ -9,7 +9,9 @@ use Pest\Exceptions\DatasetAlreadyExist;
|
|||||||
use Pest\Exceptions\DatasetDoesNotExist;
|
use Pest\Exceptions\DatasetDoesNotExist;
|
||||||
use Pest\Exceptions\ShouldNotHappen;
|
use Pest\Exceptions\ShouldNotHappen;
|
||||||
use SebastianBergmann\Exporter\Exporter;
|
use SebastianBergmann\Exporter\Exporter;
|
||||||
|
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
|
|
||||||
use Traversable;
|
use Traversable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -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 () {
|
test('it works with associative arrays', function () {
|
||||||
expect(['foo' => 'bar', 'baz' => 'boom'])
|
expect(['foo' => 'bar', 'baz' => 'boom'])
|
||||||
->sequence(
|
->sequence(
|
||||||
function ($expectation, $key) { $expectation->toEqual('bar'); $key->toEqual('foo'); },
|
function ($expectation, $key) {
|
||||||
function ($expectation, $key) { $expectation->toEqual('boom'); $key->toEqual('baz'); },
|
$expectation->toEqual('bar');
|
||||||
|
$key->toEqual('foo');
|
||||||
|
},
|
||||||
|
function ($expectation, $key) {
|
||||||
|
$expectation->toEqual('boom');
|
||||||
|
$key->toEqual('baz');
|
||||||
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Tests\CustomTestCase;
|
namespace Tests\CustomTestCase;
|
||||||
|
|
||||||
use function PHPUnit\Framework\assertTrue;
|
use function PHPUnit\Framework\assertTrue;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
abstract class CustomTestCase extends TestCase
|
abstract class CustomTestCase extends TestCase
|
||||||
|
|||||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Tests\CustomTestCase;
|
namespace Tests\CustomTestCase;
|
||||||
|
|
||||||
use function PHPUnit\Framework\assertTrue;
|
use function PHPUnit\Framework\assertTrue;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
class ExecutedTest extends TestCase
|
class ExecutedTest extends TestCase
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Pest\Plugins\Version;
|
use Pest\Plugins\Version;
|
||||||
|
|
||||||
use function Pest\version;
|
use function Pest\version;
|
||||||
|
|
||||||
use Symfony\Component\Console\Output\BufferedOutput;
|
use Symfony\Component\Console\Output\BufferedOutput;
|
||||||
|
|
||||||
it('outputs the version when --version is used', function () {
|
it('outputs the version when --version is used', function () {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ test('visual snapshot of help command output', function () {
|
|||||||
file_put_contents($snapshot, $outputBuffer->fetch());
|
file_put_contents($snapshot, $outputBuffer->fetch());
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = function () {
|
$output = function () {
|
||||||
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help']));
|
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help']));
|
||||||
|
|
||||||
$process->run();
|
$process->run();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use Symfony\Component\Process\Process;
|
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 = new Process(['php', 'bin/pest', $target], dirname(__DIR__, 2));
|
||||||
|
|
||||||
$process->run();
|
$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());
|
return $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
|
||||||
};
|
};
|
||||||
|
|
||||||
$snapshot = function ($name) {
|
$snapshot = function ($name) {
|
||||||
$testsPath = dirname(__DIR__);
|
$testsPath = dirname(__DIR__);
|
||||||
|
|
||||||
return file_get_contents(implode(DIRECTORY_SEPARATOR, [
|
return file_get_contents(implode(DIRECTORY_SEPARATOR, [
|
||||||
|
|||||||
@ -8,7 +8,7 @@ test('visual snapshot of test suite on success', function () {
|
|||||||
'success.txt',
|
'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 = (new Symfony\Component\Process\Process(['php', 'bin/pest'], dirname($testsPath), ['EXCLUDE' => 'integration', 'REBUILD_SNAPSHOTS' => false, 'PARATEST' => 0]));
|
||||||
|
|
||||||
$process->run();
|
$process->run();
|
||||||
|
|||||||
Reference in New Issue
Block a user