fix: removes both toHaveMethod and toHaveMethods

This commit is contained in:
Nuno Maduro
2024-08-28 16:30:29 -05:00
parent ecdbe7a472
commit 5ae5ac9a54
11 changed files with 106 additions and 120 deletions

View File

@ -16,7 +16,7 @@ $run = function () {
test('parallel', function () use ($run) {
expect($run('--exclude-group=integration'))
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 17 todos, 19 skipped, 1075 passed (2618 assertions)')
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 17 todos, 19 skipped, 1069 passed (2585 assertions)')
->toContain('Parallel: 3 processes');
})->skipOnWindows();

View File

@ -11,31 +11,23 @@ $run = function (string $target, bool $parallel) {
expect($process->getExitCode())->toBe(0);
return removeAnsiEscapeSequences($process->getOutput());
$output = $process->getOutput();
return preg_replace('/Duration: \d+\.\d+s/', 'Duration: x.xxs', removeAnsiEscapeSequences($output));
};
$snapshot = function ($name) {
$testsPath = dirname(__DIR__);
return file_get_contents(implode(DIRECTORY_SEPARATOR, [
$testsPath,
'.snapshots',
"$name.txt",
]));
};
test('todos', function () use ($run, $snapshot) {
expect($run('--todos', false))->toContain($snapshot('todos'));
test('todos', function () use ($run) {
expect($run('--todos', false))->toMatchSnapshot();
})->skipOnWindows();
test('todos in parallel', function () use ($run, $snapshot) {
expect($run('--todos', true))->toContain($snapshot('todos'));
test('todos in parallel', function () use ($run) {
expect($run('--todos', true))->toMatchSnapshot();
})->skipOnWindows();
test('todo', function () use ($run, $snapshot) {
expect($run('--todo', false))->toContain($snapshot('todo'));
test('todo', function () use ($run) {
expect($run('--todo', false))->toMatchSnapshot();
})->skipOnWindows();
test('todo in parallel', function () use ($run, $snapshot) {
expect($run('--todo', true))->toContain($snapshot('todo'));
test('todo in parallel', function () use ($run) {
expect($run('--todo', true))->toMatchSnapshot();
})->skipOnWindows();