You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using extension that registers subscriber, subscriber implements LoadedSubscriber (tried also with ExecutionStartedSubscriber, same result).
Current behavior
Loaded event that I'm getting has TestSuite object with name set with path to my phpunit.xml file instead of the test suite name that I run
How to reproduce
create extension
<?php
namespace My\Tests\extension;
use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;
class RegisterSubscribersExtension implements Extension
{
public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
{
$facade->registerSubscribers(
new IntegrationTestBootstrapExtension(),
);
}
}
create subscriber
<?php
namespace My\Tests\extension;
use PHPUnit\Event\TestRunner\ExecutionStarted;
use PHPUnit\Event\TestSuite\Loaded;
use PHPUnit\Event\TestSuite\LoadedSubscriber;
class IntegrationTestBootstrapExtension implements LoadedSubscriber
{
public function notify(Loaded $event): void
{
var_dump($event->testSuite()->name());die;
}
}
Summary
I am using extension that registers subscriber, subscriber implements LoadedSubscriber (tried also with ExecutionStartedSubscriber, same result).
Current behavior
Loaded event that I'm getting has TestSuite object with name set with path to my phpunit.xml file instead of the test suite name that I run
How to reproduce
create extension
create subscriber
in phpunit.xml
run tests (I run them with composer)
scripts in composer.json (I got it in "panel" subdirectory, relative to phpunit.xml)
run , with output
Expected behavior
I'd expect the TestSuite object to have name "unit-panel", not a path to phpunit.xml
The text was updated successfully, but these errors were encountered: