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

Tests configured to be in group(s) using the XML configuration file are also added to the default group #5943

Closed
sebastianbergmann opened this issue Sep 8, 2024 · 0 comments
Assignees
Labels
feature/configuration/xml feature/test-runner CLI test runner type/bug Something is broken version/11 Something affects PHPUnit 11

Comments

@sebastianbergmann
Copy link
Owner

tests
├── a
│   └── OneTest.php
└── b
    └── TwoTest.php

phpunit.xml

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
>
    <testsuites>
        <testsuite name="default">
            <directory groups="foo,baz">tests/a</directory>
            <directory groups="bar,barbara">tests/b</directory>
        </testsuite>
    </testsuites>
</phpunit>

tests/a/OneTest.php

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

final class OneTest extends TestCase
{
    public function testOne(): void
    {
        $this->assertTrue(true);
    }
}

tests/b/TwoTest.php

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

final class TwoTest extends TestCase
{
    public function testTwo(): void
    {
        $this->assertTrue(true);
    }
}

Actual

❯ ./vendor/bin/phpunit --list-groups
PHPUnit 11.3.3 by Sebastian Bergmann and contributors.

Available test group(s):
 - bar
 - barbara
 - baz
 - default
 - foo

Expected

❯ ./vendor/bin/phpunit --list-groups
PHPUnit 11.3.3 by Sebastian Bergmann and contributors.

Available test group(s):
 - bar
 - barbara
 - baz
 - foo
@sebastianbergmann sebastianbergmann added type/bug Something is broken feature/test-runner CLI test runner version/10 Something affects PHPUnit 10 feature/configuration/xml version/11 Something affects PHPUnit 11 labels Sep 8, 2024
@sebastianbergmann sebastianbergmann self-assigned this Sep 8, 2024
@sebastianbergmann sebastianbergmann removed the version/10 Something affects PHPUnit 10 label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/configuration/xml feature/test-runner CLI test runner type/bug Something is broken version/11 Something affects PHPUnit 11
Projects
None yet
Development

No branches or pull requests

1 participant