fix: test suite

This commit is contained in:
Nuno Maduro
2024-04-28 11:02:24 +01:00
parent cfa00da885
commit 335bfdb79d
9 changed files with 65 additions and 17 deletions

View File

@ -38,9 +38,9 @@
↓ is marked as todo 3
↓ shouldBeMarkedAsTodo
WARN Tests\Features\Coverage
PASS Tests\Features\Coverage
✓ it has plugin
- it adds coverage if --coverage exist → Coverage is not available
it adds coverage if --coverage exist
✓ it adds coverage if --min exist
✓ it generates coverage based on file input
@ -170,9 +170,9 @@
✓ it is a test
✓ it uses correct parent class
DEPR Tests\Features\Deprecated
FAIL Tests\Features\Deprecated
! deprecated → str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated // tests/Features/Deprecated.php:6
! user deprecated → Since foo 1.0: This is a deprecation description // vendor/symfony/deprecation-contracts/function.php:25
user deprecated
PASS Tests\Features\Describe - 5 todos
✓ before each
@ -1415,8 +1415,8 @@
✓ junit output
- junit with parallel → Not working yet
PASS Tests\Visual\Parallel
parallel
FAIL Tests\Visual\Parallel
parallel
✓ a parallel test can extend another test with same name
PASS Tests\Visual\SingleTestOrDirectory
@ -1439,5 +1439,44 @@
WARN Tests\Visual\Version
- visual snapshot of help command output
────────────────────────────────────────────────────────────────────────────
FAILED Tests\Features\Deprecated > user deprecated Error
Call to undefined function trigger_deprecation()
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 21 skipped, 1030 passed (2515 assertions)
at tests/Features/Deprecated.php:12
8▕ expect(true)->toBeTrue();
9▕ });
10▕
11▕ test('user deprecated', function () {
➜ 12▕ trigger_deprecation('foo', '1.0', 'This is a deprecation description');
13▕
14▕ expect(true)->toBeTrue();
15▕ });
16▕
1 tests/Features/Deprecated.php:12
────────────────────────────────────────────────────────────────────────────
FAILED Tests\Visual\Parallel > parallel
Expected: \n
...............sssssss......................................................\n
...............................................................s....!......\n
... (36 more lines)
To contain: Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 1017 passed (2483 assertions)
at tests/Visual/Parallel.php:19
15▕ };
16▕
17▕ test('parallel', function () use ($run) {
18▕ expect($run('--exclude-group=integration'))
➜ 19▕ ->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 1017 passed (2483 assertions)')
20▕ ->toContain('Parallel: 3 processes');
21▕ })->skipOnWindows();
22▕
23▕ test('a parallel test can extend another test with same name', function () use ($run) {
1 tests/Visual/Parallel.php:19
Tests: 1 deprecated, 2 failed, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 1030 passed (2518 assertions)

View File

@ -10,6 +10,6 @@ test('deprecated', function () {
test('user deprecated', function () {
trigger_deprecation('foo', '1.0', 'This is a deprecation description');
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
expect(true)->toBeTrue();
});