Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markTestSkipped() not handled correctly when called in "before first test" method #5165

Closed
sebastianbergmann opened this issue Feb 4, 2023 · 0 comments
Assignees
Labels
feature/test-runner CLI test runner type/bug Something is broken version/10 Something affects PHPUnit 10

Comments

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Feb 4, 2023

ExampleTest.php

<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;

final class ExampleTest extends TestCase
{
    public static function setUpBeforeClass(): void
    {
        self::markTestSkipped('message');
    }
    
    public function testOne(): void
    {
    }
    
    public function testTwo(): void
    {
    }
}

Actual Output

PHPUnit 10.0.2 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.2

E

Time: 00:00.101, Memory: 22.28 MB

There was 1 error:

1) ExampleTest
message

/home/sb/ExampleTest.php:8

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

Expected Output

PHPUnit 10.0.2 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.2

There was 1 skipped test suite:

1) Issue5165Test
message

No tests executed!
@sebastianbergmann sebastianbergmann added type/bug Something is broken feature/test-runner CLI test runner version/10 Something affects PHPUnit 10 labels Feb 4, 2023
@sebastianbergmann sebastianbergmann self-assigned this Feb 4, 2023
@sebastianbergmann sebastianbergmann changed the title markTestSkipped() in "before first test" method is treated as error markTestSkipped() not handled correctly when called in "before first test" method Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/bug Something is broken version/10 Something affects PHPUnit 10
Projects
None yet
Development

No branches or pull requests

1 participant