This commit is contained in:
Fabio Ivona
2022-08-02 11:01:17 +02:00
parent afedf83f5d
commit 1706e1d2e0
15 changed files with 30 additions and 7 deletions

View File

@ -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');
},
);
});

View File

@ -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

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Tests\CustomTestCase;
use function PHPUnit\Framework\assertTrue;
use PHPUnit\Framework\TestCase;
class ExecutedTest extends TestCase

View File

@ -1,7 +1,9 @@
<?php
use Pest\Plugins\Version;
use function Pest\version;
use Symfony\Component\Console\Output\BufferedOutput;
it('outputs the version when --version is used', function () {

View File

@ -15,7 +15,7 @@ test('visual snapshot of help command output', function () {
file_put_contents($snapshot, $outputBuffer->fetch());
}
$output = function () {
$output = function () {
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help']));
$process->run();

View File

@ -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, [

View File

@ -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();