mirror of
https://github.com/pestphp/pest.git
synced 2026-12-03 22:45:06 +01:00
a6a919c32c
* fix(tia): keep the graph writable when a path is not valid UTF-8 * test: update the suite totals for the byte-safe JSON tests --------- Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
28 lines
914 B
PHP
28 lines
914 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Tests\Fixtures\Tia\Project;
|
|
|
|
afterEach(function (): void {
|
|
Project::destroyAll();
|
|
});
|
|
|
|
test('a changed file whose name is not valid UTF-8 keeps the graph writable', function (array $arguments): void {
|
|
$project = Project::make('master');
|
|
$project->seed('master');
|
|
|
|
$project->write("caf\xe9.txt", "one\n");
|
|
|
|
$first = $project->pest('--tia', ...$arguments);
|
|
|
|
expect($first->exitCode)->toBe(0, $first->describe())
|
|
->and($first->output)->not->toContain('Could not write the dependency graph')
|
|
->and($project->graph()['baselines']['master']['tree'] ?? [])->toHaveKey("caf\xe9.txt");
|
|
|
|
$second = $project->pest('--tia', ...$arguments);
|
|
|
|
expect($second->exitCode)->toBe(0, $second->describe())
|
|
->and($second->replayed())->toBe(Project::TOTAL_TESTS, $second->describe());
|
|
})->with(Project::SEQUENTIAL_AND_PARALLEL)->onlyOnLinux();
|