Skip to content
This repository was archived by the owner on Aug 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/vendor/
composer.lock
.phpunit.result.cache
.php-cs-fixer.cache
.phpunit.cache
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
},
"require-dev": {
"broadway/broadway-saga": "^1.0",
"matthiasnoback/symfony-config-test": "^4.0 || ^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",
"matthiasnoback/symfony-config-test": "^6.2",
"matthiasnoback/symfony-dependency-injection-test": "^6.2",
"monolog/monolog": "~2.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^11.5",
"symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0 || ^7.0",
"symfony/proxy-manager-bridge": "^4.4 || ^5.3 || ^6.0",
"phpstan/phpstan-symfony": "^2.0",
Expand Down
22 changes: 6 additions & 16 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="vendor/autoload.php"
>
<phpunit backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="vendor/autoload.php" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Broadway Bundle Test Suite">
<directory>./test/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
<groups>
<exclude>
<group>functional</group>
</exclude>
</groups>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
14 changes: 6 additions & 8 deletions test/BroadwayBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@

namespace Broadway\Bundle\BroadwayBundle;

use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

/**
* @group functional
*/
#[Group('functional')]
class BroadwayBundleTest extends WebTestCase
{
/**
* @test
*
* @doesNotPerformAssertions
*/
#[Test]
#[DoesNotPerformAssertions]
public function it_does_not_throw_when_booting_kernel(): void
{
static::bootKernel();
Expand Down
7 changes: 3 additions & 4 deletions test/Command/CommandMetadataEnricherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Broadway\Bundle\BroadwayBundle\Command;

use Broadway\Domain\Metadata;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -62,7 +63,7 @@ public function setUp(): void
$this->input = $this->createMock(ArgvInput::class);
$this->input->expects($this->any())
->method('__toString')
->will($this->returnValue($this->arguments));
->willReturn($this->arguments);

$output = $this->createMock('Symfony\Component\Console\Output\OutputInterface');

Expand All @@ -71,9 +72,7 @@ public function setUp(): void
$this->metadata = new Metadata(['yolo' => 'bam']);
}

/**
* @test
*/
#[Test]
public function it_adds_the_command_class_and_arguments(): void
{
$this->enricher->handleConsoleCommandEvent($this->event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterBusSubscribersCompilerPass;
use Broadway\EventHandling\EventListener;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -33,9 +34,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
);
}

/**
* @test
*/
#[Test]
public function it_registers_event_bus_subscribers(): void
{
$this->setDefinition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterEventListenerCompilerPass;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -31,9 +32,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
);
}

/**
* @test
*/
#[Test]
public function it_registers_event_listeners(): void
{
$this->setDefinition(
Expand Down Expand Up @@ -82,9 +81,7 @@ public function it_registers_event_listeners(): void
);
}

/**
* @test
*/
#[Test]
public function it_throws_when_event_listeners_has_no_event_or_method(): void
{
$this->expectException('RuntimeException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterEventStoreCompilerPass;
use Broadway\EventStore\EventStore;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -26,19 +27,15 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new RegisterEventStoreCompilerPass());
}

/**
* @test
*/
#[Test]
public function it_sets_the_event_store_alias_to_in_memory_by_default(): void
{
$this->compile();

$this->assertContainerBuilderHasAlias('broadway.event_store', 'broadway.event_store.in_memory');
}

/**
* @test
*/
#[Test]
public function it_sets_the_public_event_store_alias(): void
{
$this->container->setParameter('broadway.event_store.service_id', 'my_event_store');
Expand All @@ -51,9 +48,7 @@ public function it_sets_the_public_event_store_alias(): void
$this->assertTrue($this->container->getAlias('broadway.event_store')->isPublic());
}

/**
* @test
*/
#[Test]
public function it_throws_when_configured_event_store_has_no_definition(): void
{
$this->expectException('InvalidArgumentException');
Expand All @@ -63,9 +58,7 @@ public function it_throws_when_configured_event_store_has_no_definition(): void
$this->compile();
}

/**
* @test
*/
#[Test]
public function it_throws_when_configured_event_store_does_not_implement_event_store_interface(): void
{
$this->expectException('InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterMetadataEnricherSubscriberPass;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -31,9 +32,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
);
}

/**
* @test
*/
#[Test]
public function it_registers_metadata_enrichers(): void
{
$this->setDefinition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterReadModelRepositoryFactoryCompilerPass;
use Broadway\ReadModel\RepositoryFactory;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -26,9 +27,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new RegisterReadModelRepositoryFactoryCompilerPass());
}

/**
* @test
*/
#[Test]
public function it_sets_the_read_model_repository_factory_alias_to_in_memory_by_default(): void
{
$this->compile();
Expand All @@ -41,9 +40,7 @@ public function it_sets_the_read_model_repository_factory_alias_to_in_memory_by_
$this->assertTrue($this->container->getAlias('broadway.read_model.repository_factory')->isPublic());
}

/**
* @test
*/
#[Test]
public function it_sets_the_read_model_repository_factory_alias(): void
{
$this->container->setParameter(
Expand All @@ -63,9 +60,7 @@ public function it_sets_the_read_model_repository_factory_alias(): void
$this->assertTrue($this->container->getAlias('broadway.read_model.repository_factory')->isPublic());
}

/**
* @test
*/
#[Test]
public function it_throws_when_configured_read_model_repository_factory_has_no_definition(): void
{
$this->expectException('InvalidArgumentException');
Expand All @@ -78,9 +73,7 @@ public function it_throws_when_configured_read_model_repository_factory_has_no_d
$this->compile();
}

/**
* @test
*/
#[Test]
public function it_throws_when_configured_read_model_repository_factory_does_not_implement_event_store_interface(): void
{
$this->expectException('InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterSagaCompilerPass;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -31,9 +32,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
);
}

/**
* @test
*/
#[Test]
public function it_registers_sagas(): void
{
$sagaManager = new Definition();
Expand Down Expand Up @@ -65,9 +64,7 @@ public function it_registers_sagas(): void
);
}

/**
* @test
*/
#[Test]
public function it_throws_when_registering_sagas_without_type(): void
{
$this->expectException('InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterSagaStateRepositoryCompilerPass;
use Broadway\Saga\State\RepositoryInterface;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -28,9 +29,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new RegisterSagaStateRepositoryCompilerPass());
}

/**
* @test
*/
#[Test]
public function it_sets_the_saga_state_repository_alias_to_in_memory_by_default(): void
{
$this->compile();
Expand All @@ -43,9 +42,7 @@ public function it_sets_the_saga_state_repository_alias_to_in_memory_by_default(
$this->assertTrue($this->container->getAlias('broadway.saga.state.repository')->isPublic());
}

/**
* @test
*/
#[Test]
public function it_sets_the_saga_state_repository_alias(): void
{
$this->container->setParameter(
Expand All @@ -65,9 +62,7 @@ public function it_sets_the_saga_state_repository_alias(): void
$this->assertTrue($this->container->getAlias('broadway.saga.state.repository')->isPublic());
}

/**
* @test
*/
#[Test]
public function it_throws_when_configured_saga_state_repository_has_no_definition(): void
{
$this->expectException('InvalidArgumentException');
Expand All @@ -80,9 +75,7 @@ public function it_throws_when_configured_saga_state_repository_has_no_definitio
$this->compile();
}

/**
* @test
*/
#[Test]
public function it_throws_when_configured_saga_state_repository_does_not_implement_event_store_interface(): void
{
$this->expectException('InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Broadway\Bundle\BroadwayBundle\DependencyInjection\RegisterSerializersCompilerPass;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use PHPUnit\Framework\Attributes\Test;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -25,9 +26,7 @@ protected function registerCompilerPass(ContainerBuilder $container): void
$container->addCompilerPass(new RegisterSerializersCompilerPass());
}

/**
* @test
*/
#[Test]
public function it_sets_the_public_serializer_aliases(): void
{
$this->setDefinition('my_serializer', new Definition());
Expand All @@ -47,9 +46,7 @@ public function it_sets_the_public_serializer_aliases(): void
$this->assertTrue($this->container->getAlias('broadway.serializer.metadata')->isPublic());
}

/**
* @test
*/
#[Test]
public function it_throws_when_serializer_has_no_definition(): void
{
$this->expectException('InvalidArgumentException');
Expand Down
Loading