write($directory, 'An existing file.'); $project->write($testFile, <<<'PHP' toMatchSnapshot(); }); PHP); $run = $project->pest($testFile, '--update-snapshots'); expect($run->exitCode)->toBe(2, $run->describe()) ->and(str_replace('\\', '/', $run->output))->toContain("Unable to write snapshot at [$directory/stores_a_snapshot.snap].") ->not->toContain('Snapshot created at') ->and(file_get_contents($project->path($directory)))->toBe('An existing file.'); })->group('integration');